forked from eatvio/eatvio_app
fix: remove ignored files
This commit is contained in:
@@ -1,200 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'selection_popup_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SelectionPopupModel {
|
||||
int? get id => throw _privateConstructorUsedError;
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
dynamic get value => throw _privateConstructorUsedError;
|
||||
bool get isSelected => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of SelectionPopupModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$SelectionPopupModelCopyWith<SelectionPopupModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SelectionPopupModelCopyWith<$Res> {
|
||||
factory $SelectionPopupModelCopyWith(
|
||||
SelectionPopupModel value, $Res Function(SelectionPopupModel) then) =
|
||||
_$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>;
|
||||
@useResult
|
||||
$Res call({int? id, String title, dynamic value, bool isSelected});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel>
|
||||
implements $SelectionPopupModelCopyWith<$Res> {
|
||||
_$SelectionPopupModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SelectionPopupModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = freezed,
|
||||
Object? title = null,
|
||||
Object? value = freezed,
|
||||
Object? isSelected = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: freezed == 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,
|
||||
value: freezed == value
|
||||
? _value.value
|
||||
: value // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
isSelected: null == isSelected
|
||||
? _value.isSelected
|
||||
: isSelected // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SelectionPopupModelImplCopyWith<$Res>
|
||||
implements $SelectionPopupModelCopyWith<$Res> {
|
||||
factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value,
|
||||
$Res Function(_$SelectionPopupModelImpl) then) =
|
||||
__$$SelectionPopupModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int? id, String title, dynamic value, bool isSelected});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SelectionPopupModelImplCopyWithImpl<$Res>
|
||||
extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl>
|
||||
implements _$$SelectionPopupModelImplCopyWith<$Res> {
|
||||
__$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value,
|
||||
$Res Function(_$SelectionPopupModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SelectionPopupModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = freezed,
|
||||
Object? title = null,
|
||||
Object? value = freezed,
|
||||
Object? isSelected = null,
|
||||
}) {
|
||||
return _then(_$SelectionPopupModelImpl(
|
||||
id: freezed == 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,
|
||||
value: freezed == value
|
||||
? _value.value
|
||||
: value // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
isSelected: null == isSelected
|
||||
? _value.isSelected
|
||||
: isSelected // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SelectionPopupModelImpl implements _SelectionPopupModel {
|
||||
const _$SelectionPopupModelImpl(
|
||||
{this.id, required this.title, this.value, this.isSelected = false});
|
||||
|
||||
@override
|
||||
final int? id;
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
final dynamic value;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isSelected;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SelectionPopupModel(id: $id, title: $title, value: $value, isSelected: $isSelected)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SelectionPopupModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
const DeepCollectionEquality().equals(other.value, value) &&
|
||||
(identical(other.isSelected, isSelected) ||
|
||||
other.isSelected == isSelected));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, title,
|
||||
const DeepCollectionEquality().hash(value), isSelected);
|
||||
|
||||
/// Create a copy of SelectionPopupModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith =>
|
||||
__$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _SelectionPopupModel implements SelectionPopupModel {
|
||||
const factory _SelectionPopupModel(
|
||||
{final int? id,
|
||||
required final String title,
|
||||
final dynamic value,
|
||||
final bool isSelected}) = _$SelectionPopupModelImpl;
|
||||
|
||||
@override
|
||||
int? get id;
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
dynamic get value;
|
||||
@override
|
||||
bool get isSelected;
|
||||
|
||||
/// Create a copy of SelectionPopupModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,818 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
Links _$LinksFromJson(Map<String, dynamic> json) {
|
||||
return _Links.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Links {
|
||||
@JsonKey(name: "first")
|
||||
String get first => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "last")
|
||||
String get last => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "prev")
|
||||
dynamic get prev => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "next")
|
||||
dynamic get next => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Links to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LinksCopyWith<Links> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LinksCopyWith<$Res> {
|
||||
factory $LinksCopyWith(Links value, $Res Function(Links) then) =
|
||||
_$LinksCopyWithImpl<$Res, Links>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "first") String first,
|
||||
@JsonKey(name: "last") String last,
|
||||
@JsonKey(name: "prev") dynamic prev,
|
||||
@JsonKey(name: "next") dynamic next});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LinksCopyWithImpl<$Res, $Val extends Links>
|
||||
implements $LinksCopyWith<$Res> {
|
||||
_$LinksCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? first = null,
|
||||
Object? last = null,
|
||||
Object? prev = freezed,
|
||||
Object? next = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
first: null == first
|
||||
? _value.first
|
||||
: first // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
last: null == last
|
||||
? _value.last
|
||||
: last // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
prev: freezed == prev
|
||||
? _value.prev
|
||||
: prev // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
next: freezed == next
|
||||
? _value.next
|
||||
: next // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> {
|
||||
factory _$$LinksImplCopyWith(
|
||||
_$LinksImpl value, $Res Function(_$LinksImpl) then) =
|
||||
__$$LinksImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "first") String first,
|
||||
@JsonKey(name: "last") String last,
|
||||
@JsonKey(name: "prev") dynamic prev,
|
||||
@JsonKey(name: "next") dynamic next});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LinksImplCopyWithImpl<$Res>
|
||||
extends _$LinksCopyWithImpl<$Res, _$LinksImpl>
|
||||
implements _$$LinksImplCopyWith<$Res> {
|
||||
__$$LinksImplCopyWithImpl(
|
||||
_$LinksImpl _value, $Res Function(_$LinksImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? first = null,
|
||||
Object? last = null,
|
||||
Object? prev = freezed,
|
||||
Object? next = freezed,
|
||||
}) {
|
||||
return _then(_$LinksImpl(
|
||||
first: null == first
|
||||
? _value.first
|
||||
: first // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
last: null == last
|
||||
? _value.last
|
||||
: last // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
prev: freezed == prev
|
||||
? _value.prev
|
||||
: prev // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
next: freezed == next
|
||||
? _value.next
|
||||
: next // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$LinksImpl implements _Links {
|
||||
const _$LinksImpl(
|
||||
{@JsonKey(name: "first") required this.first,
|
||||
@JsonKey(name: "last") required this.last,
|
||||
@JsonKey(name: "prev") required this.prev,
|
||||
@JsonKey(name: "next") required this.next});
|
||||
|
||||
factory _$LinksImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LinksImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "first")
|
||||
final String first;
|
||||
@override
|
||||
@JsonKey(name: "last")
|
||||
final String last;
|
||||
@override
|
||||
@JsonKey(name: "prev")
|
||||
final dynamic prev;
|
||||
@override
|
||||
@JsonKey(name: "next")
|
||||
final dynamic next;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Links(first: $first, last: $last, prev: $prev, next: $next)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LinksImpl &&
|
||||
(identical(other.first, first) || other.first == first) &&
|
||||
(identical(other.last, last) || other.last == last) &&
|
||||
const DeepCollectionEquality().equals(other.prev, prev) &&
|
||||
const DeepCollectionEquality().equals(other.next, next));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
first,
|
||||
last,
|
||||
const DeepCollectionEquality().hash(prev),
|
||||
const DeepCollectionEquality().hash(next));
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
|
||||
__$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$LinksImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Links implements Links {
|
||||
const factory _Links(
|
||||
{@JsonKey(name: "first") required final String first,
|
||||
@JsonKey(name: "last") required final String last,
|
||||
@JsonKey(name: "prev") required final dynamic prev,
|
||||
@JsonKey(name: "next") required final dynamic next}) = _$LinksImpl;
|
||||
|
||||
factory _Links.fromJson(Map<String, dynamic> json) = _$LinksImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "first")
|
||||
String get first;
|
||||
@override
|
||||
@JsonKey(name: "last")
|
||||
String get last;
|
||||
@override
|
||||
@JsonKey(name: "prev")
|
||||
dynamic get prev;
|
||||
@override
|
||||
@JsonKey(name: "next")
|
||||
dynamic get next;
|
||||
|
||||
/// Create a copy of Links
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Meta _$MetaFromJson(Map<String, dynamic> json) {
|
||||
return _Meta.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Meta {
|
||||
@JsonKey(name: "current_page")
|
||||
int get currentPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "from")
|
||||
dynamic get from => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "links")
|
||||
List<Link> get links => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "path")
|
||||
String? get path => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "to")
|
||||
dynamic get to => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total")
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total_min_price")
|
||||
int? get totalMinPrice => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total_max_price")
|
||||
int? get totalMaxPrice => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Meta to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$MetaCopyWith<Meta> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $MetaCopyWith<$Res> {
|
||||
factory $MetaCopyWith(Meta value, $Res Function(Meta) then) =
|
||||
_$MetaCopyWithImpl<$Res, Meta>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "current_page") int currentPage,
|
||||
@JsonKey(name: "from") dynamic from,
|
||||
@JsonKey(name: "last_page") int lastPage,
|
||||
@JsonKey(name: "links") List<Link> links,
|
||||
@JsonKey(name: "path") String? path,
|
||||
@JsonKey(name: "per_page") int perPage,
|
||||
@JsonKey(name: "to") dynamic to,
|
||||
@JsonKey(name: "total") int total,
|
||||
@JsonKey(name: "total_min_price") int? totalMinPrice,
|
||||
@JsonKey(name: "total_max_price") int? totalMaxPrice});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$MetaCopyWithImpl<$Res, $Val extends Meta>
|
||||
implements $MetaCopyWith<$Res> {
|
||||
_$MetaCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? currentPage = null,
|
||||
Object? from = freezed,
|
||||
Object? lastPage = null,
|
||||
Object? links = null,
|
||||
Object? path = freezed,
|
||||
Object? perPage = null,
|
||||
Object? to = freezed,
|
||||
Object? total = null,
|
||||
Object? totalMinPrice = freezed,
|
||||
Object? totalMaxPrice = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
currentPage: null == currentPage
|
||||
? _value.currentPage
|
||||
: currentPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
from: freezed == from
|
||||
? _value.from
|
||||
: from // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
lastPage: null == lastPage
|
||||
? _value.lastPage
|
||||
: lastPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
links: null == links
|
||||
? _value.links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as List<Link>,
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
to: freezed == to
|
||||
? _value.to
|
||||
: to // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalMinPrice: freezed == totalMinPrice
|
||||
? _value.totalMinPrice
|
||||
: totalMinPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalMaxPrice: freezed == totalMaxPrice
|
||||
? _value.totalMaxPrice
|
||||
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> {
|
||||
factory _$$MetaImplCopyWith(
|
||||
_$MetaImpl value, $Res Function(_$MetaImpl) then) =
|
||||
__$$MetaImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "current_page") int currentPage,
|
||||
@JsonKey(name: "from") dynamic from,
|
||||
@JsonKey(name: "last_page") int lastPage,
|
||||
@JsonKey(name: "links") List<Link> links,
|
||||
@JsonKey(name: "path") String? path,
|
||||
@JsonKey(name: "per_page") int perPage,
|
||||
@JsonKey(name: "to") dynamic to,
|
||||
@JsonKey(name: "total") int total,
|
||||
@JsonKey(name: "total_min_price") int? totalMinPrice,
|
||||
@JsonKey(name: "total_max_price") int? totalMaxPrice});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$MetaImplCopyWithImpl<$Res>
|
||||
extends _$MetaCopyWithImpl<$Res, _$MetaImpl>
|
||||
implements _$$MetaImplCopyWith<$Res> {
|
||||
__$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? currentPage = null,
|
||||
Object? from = freezed,
|
||||
Object? lastPage = null,
|
||||
Object? links = null,
|
||||
Object? path = freezed,
|
||||
Object? perPage = null,
|
||||
Object? to = freezed,
|
||||
Object? total = null,
|
||||
Object? totalMinPrice = freezed,
|
||||
Object? totalMaxPrice = freezed,
|
||||
}) {
|
||||
return _then(_$MetaImpl(
|
||||
currentPage: null == currentPage
|
||||
? _value.currentPage
|
||||
: currentPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
from: freezed == from
|
||||
? _value.from
|
||||
: from // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
lastPage: null == lastPage
|
||||
? _value.lastPage
|
||||
: lastPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
links: null == links
|
||||
? _value._links
|
||||
: links // ignore: cast_nullable_to_non_nullable
|
||||
as List<Link>,
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
perPage: null == perPage
|
||||
? _value.perPage
|
||||
: perPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
to: freezed == to
|
||||
? _value.to
|
||||
: to // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,
|
||||
total: null == total
|
||||
? _value.total
|
||||
: total // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalMinPrice: freezed == totalMinPrice
|
||||
? _value.totalMinPrice
|
||||
: totalMinPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalMaxPrice: freezed == totalMaxPrice
|
||||
? _value.totalMaxPrice
|
||||
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MetaImpl implements _Meta {
|
||||
const _$MetaImpl(
|
||||
{@JsonKey(name: "current_page") required this.currentPage,
|
||||
@JsonKey(name: "from") required this.from,
|
||||
@JsonKey(name: "last_page") required this.lastPage,
|
||||
@JsonKey(name: "links") required final List<Link> links,
|
||||
@JsonKey(name: "path") this.path,
|
||||
@JsonKey(name: "per_page") required this.perPage,
|
||||
@JsonKey(name: "to") required this.to,
|
||||
@JsonKey(name: "total") required this.total,
|
||||
@JsonKey(name: "total_min_price") this.totalMinPrice,
|
||||
@JsonKey(name: "total_max_price") this.totalMaxPrice})
|
||||
: _links = links;
|
||||
|
||||
factory _$MetaImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MetaImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "current_page")
|
||||
final int currentPage;
|
||||
@override
|
||||
@JsonKey(name: "from")
|
||||
final dynamic from;
|
||||
@override
|
||||
@JsonKey(name: "last_page")
|
||||
final int lastPage;
|
||||
final List<Link> _links;
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
List<Link> get links {
|
||||
if (_links is EqualUnmodifiableListView) return _links;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_links);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "path")
|
||||
final String? path;
|
||||
@override
|
||||
@JsonKey(name: "per_page")
|
||||
final int perPage;
|
||||
@override
|
||||
@JsonKey(name: "to")
|
||||
final dynamic to;
|
||||
@override
|
||||
@JsonKey(name: "total")
|
||||
final int total;
|
||||
@override
|
||||
@JsonKey(name: "total_min_price")
|
||||
final int? totalMinPrice;
|
||||
@override
|
||||
@JsonKey(name: "total_max_price")
|
||||
final int? totalMaxPrice;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Meta(currentPage: $currentPage, from: $from, lastPage: $lastPage, links: $links, path: $path, perPage: $perPage, to: $to, total: $total, totalMinPrice: $totalMinPrice, totalMaxPrice: $totalMaxPrice)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$MetaImpl &&
|
||||
(identical(other.currentPage, currentPage) ||
|
||||
other.currentPage == currentPage) &&
|
||||
const DeepCollectionEquality().equals(other.from, from) &&
|
||||
(identical(other.lastPage, lastPage) ||
|
||||
other.lastPage == lastPage) &&
|
||||
const DeepCollectionEquality().equals(other._links, _links) &&
|
||||
(identical(other.path, path) || other.path == path) &&
|
||||
(identical(other.perPage, perPage) || other.perPage == perPage) &&
|
||||
const DeepCollectionEquality().equals(other.to, to) &&
|
||||
(identical(other.total, total) || other.total == total) &&
|
||||
(identical(other.totalMinPrice, totalMinPrice) ||
|
||||
other.totalMinPrice == totalMinPrice) &&
|
||||
(identical(other.totalMaxPrice, totalMaxPrice) ||
|
||||
other.totalMaxPrice == totalMaxPrice));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
currentPage,
|
||||
const DeepCollectionEquality().hash(from),
|
||||
lastPage,
|
||||
const DeepCollectionEquality().hash(_links),
|
||||
path,
|
||||
perPage,
|
||||
const DeepCollectionEquality().hash(to),
|
||||
total,
|
||||
totalMinPrice,
|
||||
totalMaxPrice);
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
|
||||
__$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MetaImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Meta implements Meta {
|
||||
const factory _Meta(
|
||||
{@JsonKey(name: "current_page") required final int currentPage,
|
||||
@JsonKey(name: "from") required final dynamic from,
|
||||
@JsonKey(name: "last_page") required final int lastPage,
|
||||
@JsonKey(name: "links") required final List<Link> links,
|
||||
@JsonKey(name: "path") final String? path,
|
||||
@JsonKey(name: "per_page") required final int perPage,
|
||||
@JsonKey(name: "to") required final dynamic to,
|
||||
@JsonKey(name: "total") required final int total,
|
||||
@JsonKey(name: "total_min_price") final int? totalMinPrice,
|
||||
@JsonKey(name: "total_max_price") final int? totalMaxPrice}) = _$MetaImpl;
|
||||
|
||||
factory _Meta.fromJson(Map<String, dynamic> json) = _$MetaImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "current_page")
|
||||
int get currentPage;
|
||||
@override
|
||||
@JsonKey(name: "from")
|
||||
dynamic get from;
|
||||
@override
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage;
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
List<Link> get links;
|
||||
@override
|
||||
@JsonKey(name: "path")
|
||||
String? get path;
|
||||
@override
|
||||
@JsonKey(name: "per_page")
|
||||
int get perPage;
|
||||
@override
|
||||
@JsonKey(name: "to")
|
||||
dynamic get to;
|
||||
@override
|
||||
@JsonKey(name: "total")
|
||||
int get total;
|
||||
@override
|
||||
@JsonKey(name: "total_min_price")
|
||||
int? get totalMinPrice;
|
||||
@override
|
||||
@JsonKey(name: "total_max_price")
|
||||
int? get totalMaxPrice;
|
||||
|
||||
/// Create a copy of Meta
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Link _$LinkFromJson(Map<String, dynamic> json) {
|
||||
return _Link.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Link {
|
||||
@JsonKey(name: "url")
|
||||
String? get url => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "label")
|
||||
String? get label => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "active")
|
||||
bool? get active => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Link to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LinkCopyWith<Link> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LinkCopyWith<$Res> {
|
||||
factory $LinkCopyWith(Link value, $Res Function(Link) then) =
|
||||
_$LinkCopyWithImpl<$Res, Link>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "url") String? url,
|
||||
@JsonKey(name: "label") String? label,
|
||||
@JsonKey(name: "active") bool? active});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LinkCopyWithImpl<$Res, $Val extends Link>
|
||||
implements $LinkCopyWith<$Res> {
|
||||
_$LinkCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? url = freezed,
|
||||
Object? label = freezed,
|
||||
Object? active = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
url: freezed == url
|
||||
? _value.url
|
||||
: url // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
label: freezed == label
|
||||
? _value.label
|
||||
: label // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
active: freezed == active
|
||||
? _value.active
|
||||
: active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> {
|
||||
factory _$$LinkImplCopyWith(
|
||||
_$LinkImpl value, $Res Function(_$LinkImpl) then) =
|
||||
__$$LinkImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "url") String? url,
|
||||
@JsonKey(name: "label") String? label,
|
||||
@JsonKey(name: "active") bool? active});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LinkImplCopyWithImpl<$Res>
|
||||
extends _$LinkCopyWithImpl<$Res, _$LinkImpl>
|
||||
implements _$$LinkImplCopyWith<$Res> {
|
||||
__$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? url = freezed,
|
||||
Object? label = freezed,
|
||||
Object? active = freezed,
|
||||
}) {
|
||||
return _then(_$LinkImpl(
|
||||
url: freezed == url
|
||||
? _value.url
|
||||
: url // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
label: freezed == label
|
||||
? _value.label
|
||||
: label // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
active: freezed == active
|
||||
? _value.active
|
||||
: active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$LinkImpl implements _Link {
|
||||
const _$LinkImpl(
|
||||
{@JsonKey(name: "url") this.url,
|
||||
@JsonKey(name: "label") this.label,
|
||||
@JsonKey(name: "active") this.active});
|
||||
|
||||
factory _$LinkImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LinkImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "url")
|
||||
final String? url;
|
||||
@override
|
||||
@JsonKey(name: "label")
|
||||
final String? label;
|
||||
@override
|
||||
@JsonKey(name: "active")
|
||||
final bool? active;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Link(url: $url, label: $label, active: $active)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LinkImpl &&
|
||||
(identical(other.url, url) || other.url == url) &&
|
||||
(identical(other.label, label) || other.label == label) &&
|
||||
(identical(other.active, active) || other.active == active));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, url, label, active);
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
|
||||
__$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$LinkImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Link implements Link {
|
||||
const factory _Link(
|
||||
{@JsonKey(name: "url") final String? url,
|
||||
@JsonKey(name: "label") final String? label,
|
||||
@JsonKey(name: "active") final bool? active}) = _$LinkImpl;
|
||||
|
||||
factory _Link.fromJson(Map<String, dynamic> json) = _$LinkImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "url")
|
||||
String? get url;
|
||||
@override
|
||||
@JsonKey(name: "label")
|
||||
String? get label;
|
||||
@override
|
||||
@JsonKey(name: "active")
|
||||
bool? get active;
|
||||
|
||||
/// Create a copy of Link
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$LinksImpl _$$LinksImplFromJson(Map<String, dynamic> json) => _$LinksImpl(
|
||||
first: json['first'] as String,
|
||||
last: json['last'] as String,
|
||||
prev: json['prev'],
|
||||
next: json['next'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'first': instance.first,
|
||||
'last': instance.last,
|
||||
'prev': instance.prev,
|
||||
'next': instance.next,
|
||||
};
|
||||
|
||||
_$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
|
||||
currentPage: (json['current_page'] as num).toInt(),
|
||||
from: json['from'],
|
||||
lastPage: (json['last_page'] as num).toInt(),
|
||||
links: (json['links'] as List<dynamic>)
|
||||
.map((e) => Link.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
path: json['path'] as String?,
|
||||
perPage: (json['per_page'] as num).toInt(),
|
||||
to: json['to'],
|
||||
total: (json['total'] as num).toInt(),
|
||||
totalMinPrice: (json['total_min_price'] as num?)?.toInt(),
|
||||
totalMaxPrice: (json['total_max_price'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'current_page': instance.currentPage,
|
||||
'from': instance.from,
|
||||
'last_page': instance.lastPage,
|
||||
'links': instance.links,
|
||||
'path': instance.path,
|
||||
'per_page': instance.perPage,
|
||||
'to': instance.to,
|
||||
'total': instance.total,
|
||||
'total_min_price': instance.totalMinPrice,
|
||||
'total_max_price': instance.totalMaxPrice,
|
||||
};
|
||||
|
||||
_$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> json) => _$LinkImpl(
|
||||
url: json['url'] as String?,
|
||||
label: json['label'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'url': instance.url,
|
||||
'label': instance.label,
|
||||
'active': instance.active,
|
||||
};
|
||||
@@ -1,73 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'ws_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _WsService implements WsService {
|
||||
_WsService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<WebsocketInfoModel> getWebsocket() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<WebsocketInfoModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/ws/params',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late WebsocketInfoModel _value;
|
||||
try {
|
||||
_value = WebsocketInfoModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'credentials_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
CredentialsModel _$CredentialsModelFromJson(Map<String, dynamic> json) {
|
||||
return _CredentialsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CredentialsModel {
|
||||
String get email => throw _privateConstructorUsedError;
|
||||
String get password => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CredentialsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CredentialsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CredentialsModelCopyWith<CredentialsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CredentialsModelCopyWith<$Res> {
|
||||
factory $CredentialsModelCopyWith(
|
||||
CredentialsModel value, $Res Function(CredentialsModel) then) =
|
||||
_$CredentialsModelCopyWithImpl<$Res, CredentialsModel>;
|
||||
@useResult
|
||||
$Res call({String email, String password});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CredentialsModelCopyWithImpl<$Res, $Val extends CredentialsModel>
|
||||
implements $CredentialsModelCopyWith<$Res> {
|
||||
_$CredentialsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CredentialsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? email = null,
|
||||
Object? password = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
email: null == email
|
||||
? _value.email
|
||||
: email // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
password: null == password
|
||||
? _value.password
|
||||
: password // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CredentialsModelImplCopyWith<$Res>
|
||||
implements $CredentialsModelCopyWith<$Res> {
|
||||
factory _$$CredentialsModelImplCopyWith(_$CredentialsModelImpl value,
|
||||
$Res Function(_$CredentialsModelImpl) then) =
|
||||
__$$CredentialsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String email, String password});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CredentialsModelImplCopyWithImpl<$Res>
|
||||
extends _$CredentialsModelCopyWithImpl<$Res, _$CredentialsModelImpl>
|
||||
implements _$$CredentialsModelImplCopyWith<$Res> {
|
||||
__$$CredentialsModelImplCopyWithImpl(_$CredentialsModelImpl _value,
|
||||
$Res Function(_$CredentialsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CredentialsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? email = null,
|
||||
Object? password = null,
|
||||
}) {
|
||||
return _then(_$CredentialsModelImpl(
|
||||
email: null == email
|
||||
? _value.email
|
||||
: email // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
password: null == password
|
||||
? _value.password
|
||||
: password // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CredentialsModelImpl implements _CredentialsModel {
|
||||
const _$CredentialsModelImpl({required this.email, required this.password});
|
||||
|
||||
factory _$CredentialsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CredentialsModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String email;
|
||||
@override
|
||||
final String password;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CredentialsModel(email: $email, password: $password)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CredentialsModelImpl &&
|
||||
(identical(other.email, email) || other.email == email) &&
|
||||
(identical(other.password, password) ||
|
||||
other.password == password));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, email, password);
|
||||
|
||||
/// Create a copy of CredentialsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CredentialsModelImplCopyWith<_$CredentialsModelImpl> get copyWith =>
|
||||
__$$CredentialsModelImplCopyWithImpl<_$CredentialsModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CredentialsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CredentialsModel implements CredentialsModel {
|
||||
const factory _CredentialsModel(
|
||||
{required final String email,
|
||||
required final String password}) = _$CredentialsModelImpl;
|
||||
|
||||
factory _CredentialsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CredentialsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get email;
|
||||
@override
|
||||
String get password;
|
||||
|
||||
/// Create a copy of CredentialsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CredentialsModelImplCopyWith<_$CredentialsModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'credentials_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CredentialsModelImpl _$$CredentialsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CredentialsModelImpl(
|
||||
email: json['email'] as String,
|
||||
password: json['password'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CredentialsModelImplToJson(
|
||||
_$CredentialsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'email': instance.email,
|
||||
'password': instance.password,
|
||||
};
|
||||
@@ -1,164 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'token_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
TokenModel _$TokenModelFromJson(Map<String, dynamic> json) {
|
||||
return _TokenModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TokenModel {
|
||||
String get token => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TokenModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of TokenModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$TokenModelCopyWith<TokenModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $TokenModelCopyWith<$Res> {
|
||||
factory $TokenModelCopyWith(
|
||||
TokenModel value, $Res Function(TokenModel) then) =
|
||||
_$TokenModelCopyWithImpl<$Res, TokenModel>;
|
||||
@useResult
|
||||
$Res call({String token});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$TokenModelCopyWithImpl<$Res, $Val extends TokenModel>
|
||||
implements $TokenModelCopyWith<$Res> {
|
||||
_$TokenModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of TokenModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? token = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
token: null == token
|
||||
? _value.token
|
||||
: token // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$TokenModelImplCopyWith<$Res>
|
||||
implements $TokenModelCopyWith<$Res> {
|
||||
factory _$$TokenModelImplCopyWith(
|
||||
_$TokenModelImpl value, $Res Function(_$TokenModelImpl) then) =
|
||||
__$$TokenModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String token});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$TokenModelImplCopyWithImpl<$Res>
|
||||
extends _$TokenModelCopyWithImpl<$Res, _$TokenModelImpl>
|
||||
implements _$$TokenModelImplCopyWith<$Res> {
|
||||
__$$TokenModelImplCopyWithImpl(
|
||||
_$TokenModelImpl _value, $Res Function(_$TokenModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of TokenModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? token = null,
|
||||
}) {
|
||||
return _then(_$TokenModelImpl(
|
||||
token: null == token
|
||||
? _value.token
|
||||
: token // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$TokenModelImpl implements _TokenModel {
|
||||
const _$TokenModelImpl({required this.token});
|
||||
|
||||
factory _$TokenModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$TokenModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String token;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TokenModel(token: $token)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$TokenModelImpl &&
|
||||
(identical(other.token, token) || other.token == token));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, token);
|
||||
|
||||
/// Create a copy of TokenModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$TokenModelImplCopyWith<_$TokenModelImpl> get copyWith =>
|
||||
__$$TokenModelImplCopyWithImpl<_$TokenModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$TokenModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _TokenModel implements TokenModel {
|
||||
const factory _TokenModel({required final String token}) = _$TokenModelImpl;
|
||||
|
||||
factory _TokenModel.fromJson(Map<String, dynamic> json) =
|
||||
_$TokenModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get token;
|
||||
|
||||
/// Create a copy of TokenModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$TokenModelImplCopyWith<_$TokenModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'token_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$TokenModelImpl _$$TokenModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$TokenModelImpl(
|
||||
token: json['token'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TokenModelImplToJson(_$TokenModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'token': instance.token,
|
||||
};
|
||||
@@ -1,632 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'auth_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AuthState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String token) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String token)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String token)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AuthState value) $default, {
|
||||
required TResult Function(AuthStateLoading value) loading,
|
||||
required TResult Function(AuthStateLoaded value) loaded,
|
||||
required TResult Function(AuthStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AuthState value)? $default, {
|
||||
TResult? Function(AuthStateLoading value)? loading,
|
||||
TResult? Function(AuthStateLoaded value)? loaded,
|
||||
TResult? Function(AuthStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AuthState value)? $default, {
|
||||
TResult Function(AuthStateLoading value)? loading,
|
||||
TResult Function(AuthStateLoaded value)? loaded,
|
||||
TResult Function(AuthStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AuthStateCopyWith<$Res> {
|
||||
factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
|
||||
_$AuthStateCopyWithImpl<$Res, AuthState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
|
||||
implements $AuthStateCopyWith<$Res> {
|
||||
_$AuthStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AuthStateImplCopyWith<$Res> {
|
||||
factory _$$AuthStateImplCopyWith(
|
||||
_$AuthStateImpl value, $Res Function(_$AuthStateImpl) then) =
|
||||
__$$AuthStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AuthStateImplCopyWithImpl<$Res>
|
||||
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateImpl>
|
||||
implements _$$AuthStateImplCopyWith<$Res> {
|
||||
__$$AuthStateImplCopyWithImpl(
|
||||
_$AuthStateImpl _value, $Res Function(_$AuthStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AuthStateImpl implements _AuthState {
|
||||
const _$AuthStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$AuthStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String token) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String token)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String token)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AuthState value) $default, {
|
||||
required TResult Function(AuthStateLoading value) loading,
|
||||
required TResult Function(AuthStateLoaded value) loaded,
|
||||
required TResult Function(AuthStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AuthState value)? $default, {
|
||||
TResult? Function(AuthStateLoading value)? loading,
|
||||
TResult? Function(AuthStateLoaded value)? loaded,
|
||||
TResult? Function(AuthStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AuthState value)? $default, {
|
||||
TResult Function(AuthStateLoading value)? loading,
|
||||
TResult Function(AuthStateLoaded value)? loaded,
|
||||
TResult Function(AuthStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _AuthState implements AuthState {
|
||||
const factory _AuthState() = _$AuthStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AuthStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$AuthStateLoadingImplCopyWith(_$AuthStateLoadingImpl value,
|
||||
$Res Function(_$AuthStateLoadingImpl) then) =
|
||||
__$$AuthStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AuthStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateLoadingImpl>
|
||||
implements _$$AuthStateLoadingImplCopyWith<$Res> {
|
||||
__$$AuthStateLoadingImplCopyWithImpl(_$AuthStateLoadingImpl _value,
|
||||
$Res Function(_$AuthStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AuthStateLoadingImpl implements AuthStateLoading {
|
||||
const _$AuthStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$AuthStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String token) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String token)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String token)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AuthState value) $default, {
|
||||
required TResult Function(AuthStateLoading value) loading,
|
||||
required TResult Function(AuthStateLoaded value) loaded,
|
||||
required TResult Function(AuthStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AuthState value)? $default, {
|
||||
TResult? Function(AuthStateLoading value)? loading,
|
||||
TResult? Function(AuthStateLoaded value)? loaded,
|
||||
TResult? Function(AuthStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AuthState value)? $default, {
|
||||
TResult Function(AuthStateLoading value)? loading,
|
||||
TResult Function(AuthStateLoaded value)? loaded,
|
||||
TResult Function(AuthStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AuthStateLoading implements AuthState {
|
||||
const factory AuthStateLoading() = _$AuthStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AuthStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$AuthStateLoadedImplCopyWith(_$AuthStateLoadedImpl value,
|
||||
$Res Function(_$AuthStateLoadedImpl) then) =
|
||||
__$$AuthStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String token});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AuthStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateLoadedImpl>
|
||||
implements _$$AuthStateLoadedImplCopyWith<$Res> {
|
||||
__$$AuthStateLoadedImplCopyWithImpl(
|
||||
_$AuthStateLoadedImpl _value, $Res Function(_$AuthStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? token = null,
|
||||
}) {
|
||||
return _then(_$AuthStateLoadedImpl(
|
||||
token: null == token
|
||||
? _value.token
|
||||
: token // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AuthStateLoadedImpl implements AuthStateLoaded {
|
||||
const _$AuthStateLoadedImpl({required this.token});
|
||||
|
||||
@override
|
||||
final String token;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthState.loaded(token: $token)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AuthStateLoadedImpl &&
|
||||
(identical(other.token, token) || other.token == token));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, token);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$AuthStateLoadedImplCopyWith<_$AuthStateLoadedImpl> get copyWith =>
|
||||
__$$AuthStateLoadedImplCopyWithImpl<_$AuthStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String token) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(token);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String token)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(token);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String token)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(token);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AuthState value) $default, {
|
||||
required TResult Function(AuthStateLoading value) loading,
|
||||
required TResult Function(AuthStateLoaded value) loaded,
|
||||
required TResult Function(AuthStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AuthState value)? $default, {
|
||||
TResult? Function(AuthStateLoading value)? loading,
|
||||
TResult? Function(AuthStateLoaded value)? loaded,
|
||||
TResult? Function(AuthStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AuthState value)? $default, {
|
||||
TResult Function(AuthStateLoading value)? loading,
|
||||
TResult Function(AuthStateLoaded value)? loaded,
|
||||
TResult Function(AuthStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AuthStateLoaded implements AuthState {
|
||||
const factory AuthStateLoaded({required final String token}) =
|
||||
_$AuthStateLoadedImpl;
|
||||
|
||||
String get token;
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$AuthStateLoadedImplCopyWith<_$AuthStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AuthStateErrorImplCopyWith<$Res> {
|
||||
factory _$$AuthStateErrorImplCopyWith(_$AuthStateErrorImpl value,
|
||||
$Res Function(_$AuthStateErrorImpl) then) =
|
||||
__$$AuthStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AuthStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateErrorImpl>
|
||||
implements _$$AuthStateErrorImplCopyWith<$Res> {
|
||||
__$$AuthStateErrorImplCopyWithImpl(
|
||||
_$AuthStateErrorImpl _value, $Res Function(_$AuthStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$AuthStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AuthStateErrorImpl implements AuthStateError {
|
||||
const _$AuthStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$AuthStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$AuthStateErrorImplCopyWith<_$AuthStateErrorImpl> get copyWith =>
|
||||
__$$AuthStateErrorImplCopyWithImpl<_$AuthStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String token) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String token)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String token)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AuthState value) $default, {
|
||||
required TResult Function(AuthStateLoading value) loading,
|
||||
required TResult Function(AuthStateLoaded value) loaded,
|
||||
required TResult Function(AuthStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AuthState value)? $default, {
|
||||
TResult? Function(AuthStateLoading value)? loading,
|
||||
TResult? Function(AuthStateLoaded value)? loaded,
|
||||
TResult? Function(AuthStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AuthState value)? $default, {
|
||||
TResult Function(AuthStateLoading value)? loading,
|
||||
TResult Function(AuthStateLoaded value)? loaded,
|
||||
TResult Function(AuthStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AuthStateError implements AuthState {
|
||||
const factory AuthStateError({required final String errorMessage}) =
|
||||
_$AuthStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of AuthState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$AuthStateErrorImplCopyWith<_$AuthStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'auth_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _AuthService implements AuthService {
|
||||
_AuthService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<TokenModel> getTokenByCredentials({
|
||||
required CredentialsModel credentials,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = credentials;
|
||||
final _options = _setStreamType<TokenModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/login',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late TokenModel _value;
|
||||
try {
|
||||
_value = TokenModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,608 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'blog_post_create_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$BlogPostCreateState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function() loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function()? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function()? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value) $default, {
|
||||
required TResult Function(BlogPostCreateStateLoading value) loading,
|
||||
required TResult Function(BlogPostCreateStateLoaded value) loaded,
|
||||
required TResult Function(BlogPostCreateStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_BlogPostCreateState value)? $default, {
|
||||
TResult? Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult? Function(BlogPostCreateStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value)? $default, {
|
||||
TResult Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult Function(BlogPostCreateStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $BlogPostCreateStateCopyWith<$Res> {
|
||||
factory $BlogPostCreateStateCopyWith(
|
||||
BlogPostCreateState value, $Res Function(BlogPostCreateState) then) =
|
||||
_$BlogPostCreateStateCopyWithImpl<$Res, BlogPostCreateState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$BlogPostCreateStateCopyWithImpl<$Res, $Val extends BlogPostCreateState>
|
||||
implements $BlogPostCreateStateCopyWith<$Res> {
|
||||
_$BlogPostCreateStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$BlogPostCreateStateImplCopyWith<$Res> {
|
||||
factory _$$BlogPostCreateStateImplCopyWith(_$BlogPostCreateStateImpl value,
|
||||
$Res Function(_$BlogPostCreateStateImpl) then) =
|
||||
__$$BlogPostCreateStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$BlogPostCreateStateImplCopyWithImpl<$Res>
|
||||
extends _$BlogPostCreateStateCopyWithImpl<$Res, _$BlogPostCreateStateImpl>
|
||||
implements _$$BlogPostCreateStateImplCopyWith<$Res> {
|
||||
__$$BlogPostCreateStateImplCopyWithImpl(_$BlogPostCreateStateImpl _value,
|
||||
$Res Function(_$BlogPostCreateStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$BlogPostCreateStateImpl implements _BlogPostCreateState {
|
||||
const _$BlogPostCreateStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlogPostCreateState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$BlogPostCreateStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function() loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function()? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function()? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value) $default, {
|
||||
required TResult Function(BlogPostCreateStateLoading value) loading,
|
||||
required TResult Function(BlogPostCreateStateLoaded value) loaded,
|
||||
required TResult Function(BlogPostCreateStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_BlogPostCreateState value)? $default, {
|
||||
TResult? Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult? Function(BlogPostCreateStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value)? $default, {
|
||||
TResult Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult Function(BlogPostCreateStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _BlogPostCreateState implements BlogPostCreateState {
|
||||
const factory _BlogPostCreateState() = _$BlogPostCreateStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$BlogPostCreateStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$BlogPostCreateStateLoadingImplCopyWith(
|
||||
_$BlogPostCreateStateLoadingImpl value,
|
||||
$Res Function(_$BlogPostCreateStateLoadingImpl) then) =
|
||||
__$$BlogPostCreateStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$BlogPostCreateStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$BlogPostCreateStateCopyWithImpl<$Res,
|
||||
_$BlogPostCreateStateLoadingImpl>
|
||||
implements _$$BlogPostCreateStateLoadingImplCopyWith<$Res> {
|
||||
__$$BlogPostCreateStateLoadingImplCopyWithImpl(
|
||||
_$BlogPostCreateStateLoadingImpl _value,
|
||||
$Res Function(_$BlogPostCreateStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$BlogPostCreateStateLoadingImpl implements BlogPostCreateStateLoading {
|
||||
const _$BlogPostCreateStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlogPostCreateState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$BlogPostCreateStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function() loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function()? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function()? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value) $default, {
|
||||
required TResult Function(BlogPostCreateStateLoading value) loading,
|
||||
required TResult Function(BlogPostCreateStateLoaded value) loaded,
|
||||
required TResult Function(BlogPostCreateStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_BlogPostCreateState value)? $default, {
|
||||
TResult? Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult? Function(BlogPostCreateStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value)? $default, {
|
||||
TResult Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult Function(BlogPostCreateStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BlogPostCreateStateLoading implements BlogPostCreateState {
|
||||
const factory BlogPostCreateStateLoading() = _$BlogPostCreateStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$BlogPostCreateStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$BlogPostCreateStateLoadedImplCopyWith(
|
||||
_$BlogPostCreateStateLoadedImpl value,
|
||||
$Res Function(_$BlogPostCreateStateLoadedImpl) then) =
|
||||
__$$BlogPostCreateStateLoadedImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$BlogPostCreateStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$BlogPostCreateStateCopyWithImpl<$Res,
|
||||
_$BlogPostCreateStateLoadedImpl>
|
||||
implements _$$BlogPostCreateStateLoadedImplCopyWith<$Res> {
|
||||
__$$BlogPostCreateStateLoadedImplCopyWithImpl(
|
||||
_$BlogPostCreateStateLoadedImpl _value,
|
||||
$Res Function(_$BlogPostCreateStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$BlogPostCreateStateLoadedImpl implements BlogPostCreateStateLoaded {
|
||||
const _$BlogPostCreateStateLoadedImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlogPostCreateState.loaded()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$BlogPostCreateStateLoadedImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function() loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function()? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function()? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value) $default, {
|
||||
required TResult Function(BlogPostCreateStateLoading value) loading,
|
||||
required TResult Function(BlogPostCreateStateLoaded value) loaded,
|
||||
required TResult Function(BlogPostCreateStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_BlogPostCreateState value)? $default, {
|
||||
TResult? Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult? Function(BlogPostCreateStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value)? $default, {
|
||||
TResult Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult Function(BlogPostCreateStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BlogPostCreateStateLoaded implements BlogPostCreateState {
|
||||
const factory BlogPostCreateStateLoaded() = _$BlogPostCreateStateLoadedImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$BlogPostCreateStateErrorImplCopyWith<$Res> {
|
||||
factory _$$BlogPostCreateStateErrorImplCopyWith(
|
||||
_$BlogPostCreateStateErrorImpl value,
|
||||
$Res Function(_$BlogPostCreateStateErrorImpl) then) =
|
||||
__$$BlogPostCreateStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$BlogPostCreateStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$BlogPostCreateStateCopyWithImpl<$Res,
|
||||
_$BlogPostCreateStateErrorImpl>
|
||||
implements _$$BlogPostCreateStateErrorImplCopyWith<$Res> {
|
||||
__$$BlogPostCreateStateErrorImplCopyWithImpl(
|
||||
_$BlogPostCreateStateErrorImpl _value,
|
||||
$Res Function(_$BlogPostCreateStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$BlogPostCreateStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$BlogPostCreateStateErrorImpl implements BlogPostCreateStateError {
|
||||
const _$BlogPostCreateStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlogPostCreateState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$BlogPostCreateStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$BlogPostCreateStateErrorImplCopyWith<_$BlogPostCreateStateErrorImpl>
|
||||
get copyWith => __$$BlogPostCreateStateErrorImplCopyWithImpl<
|
||||
_$BlogPostCreateStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function() loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function()? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function()? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value) $default, {
|
||||
required TResult Function(BlogPostCreateStateLoading value) loading,
|
||||
required TResult Function(BlogPostCreateStateLoaded value) loaded,
|
||||
required TResult Function(BlogPostCreateStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_BlogPostCreateState value)? $default, {
|
||||
TResult? Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult? Function(BlogPostCreateStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_BlogPostCreateState value)? $default, {
|
||||
TResult Function(BlogPostCreateStateLoading value)? loading,
|
||||
TResult Function(BlogPostCreateStateLoaded value)? loaded,
|
||||
TResult Function(BlogPostCreateStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BlogPostCreateStateError implements BlogPostCreateState {
|
||||
const factory BlogPostCreateStateError({required final String errorMessage}) =
|
||||
_$BlogPostCreateStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of BlogPostCreateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$BlogPostCreateStateErrorImplCopyWith<_$BlogPostCreateStateErrorImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'blog_post_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _BlogPostService implements BlogPostService {
|
||||
_BlogPostService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> createBlogPost({required FormData formData}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/create/published',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateBlogPost({
|
||||
required int id,
|
||||
required FormData formData,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/update/published/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteBlogPost({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/delete/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,639 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'new_messages_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NewMessagesState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(int messagesCount) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(int messagesCount)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(int messagesCount)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value) $default, {
|
||||
required TResult Function(NewMessagesStateEmpty value) empty,
|
||||
required TResult Function(NewMessagesStateLoaded value) loaded,
|
||||
required TResult Function(NewMessagesStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NewMessagesState value)? $default, {
|
||||
TResult? Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult? Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult? Function(NewMessagesStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value)? $default, {
|
||||
TResult Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult Function(NewMessagesStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NewMessagesStateCopyWith<$Res> {
|
||||
factory $NewMessagesStateCopyWith(
|
||||
NewMessagesState value, $Res Function(NewMessagesState) then) =
|
||||
_$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState>
|
||||
implements $NewMessagesStateCopyWith<$Res> {
|
||||
_$NewMessagesStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NewMessagesStateImplCopyWith<$Res> {
|
||||
factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value,
|
||||
$Res Function(_$NewMessagesStateImpl) then) =
|
||||
__$$NewMessagesStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NewMessagesStateImplCopyWithImpl<$Res>
|
||||
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl>
|
||||
implements _$$NewMessagesStateImplCopyWith<$Res> {
|
||||
__$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value,
|
||||
$Res Function(_$NewMessagesStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NewMessagesStateImpl implements _NewMessagesState {
|
||||
const _$NewMessagesStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NewMessagesState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$NewMessagesStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(int messagesCount) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(int messagesCount)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(int messagesCount)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value) $default, {
|
||||
required TResult Function(NewMessagesStateEmpty value) empty,
|
||||
required TResult Function(NewMessagesStateLoaded value) loaded,
|
||||
required TResult Function(NewMessagesStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NewMessagesState value)? $default, {
|
||||
TResult? Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult? Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult? Function(NewMessagesStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value)? $default, {
|
||||
TResult Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult Function(NewMessagesStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _NewMessagesState implements NewMessagesState {
|
||||
const factory _NewMessagesState() = _$NewMessagesStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> {
|
||||
factory _$$NewMessagesStateEmptyImplCopyWith(
|
||||
_$NewMessagesStateEmptyImpl value,
|
||||
$Res Function(_$NewMessagesStateEmptyImpl) then) =
|
||||
__$$NewMessagesStateEmptyImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>
|
||||
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl>
|
||||
implements _$$NewMessagesStateEmptyImplCopyWith<$Res> {
|
||||
__$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value,
|
||||
$Res Function(_$NewMessagesStateEmptyImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NewMessagesStateEmptyImpl implements NewMessagesStateEmpty {
|
||||
const _$NewMessagesStateEmptyImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NewMessagesState.empty()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NewMessagesStateEmptyImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(int messagesCount) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return empty();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(int messagesCount)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return empty?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(int messagesCount)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (empty != null) {
|
||||
return empty();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value) $default, {
|
||||
required TResult Function(NewMessagesStateEmpty value) empty,
|
||||
required TResult Function(NewMessagesStateLoaded value) loaded,
|
||||
required TResult Function(NewMessagesStateError value) error,
|
||||
}) {
|
||||
return empty(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NewMessagesState value)? $default, {
|
||||
TResult? Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult? Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult? Function(NewMessagesStateError value)? error,
|
||||
}) {
|
||||
return empty?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value)? $default, {
|
||||
TResult Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult Function(NewMessagesStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (empty != null) {
|
||||
return empty(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NewMessagesStateEmpty implements NewMessagesState {
|
||||
const factory NewMessagesStateEmpty() = _$NewMessagesStateEmptyImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$NewMessagesStateLoadedImplCopyWith(
|
||||
_$NewMessagesStateLoadedImpl value,
|
||||
$Res Function(_$NewMessagesStateLoadedImpl) then) =
|
||||
__$$NewMessagesStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({int messagesCount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl>
|
||||
implements _$$NewMessagesStateLoadedImplCopyWith<$Res> {
|
||||
__$$NewMessagesStateLoadedImplCopyWithImpl(
|
||||
_$NewMessagesStateLoadedImpl _value,
|
||||
$Res Function(_$NewMessagesStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? messagesCount = null,
|
||||
}) {
|
||||
return _then(_$NewMessagesStateLoadedImpl(
|
||||
messagesCount: null == messagesCount
|
||||
? _value.messagesCount
|
||||
: messagesCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded {
|
||||
const _$NewMessagesStateLoadedImpl({required this.messagesCount});
|
||||
|
||||
@override
|
||||
final int messagesCount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NewMessagesState.loaded(messagesCount: $messagesCount)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NewMessagesStateLoadedImpl &&
|
||||
(identical(other.messagesCount, messagesCount) ||
|
||||
other.messagesCount == messagesCount));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, messagesCount);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
|
||||
get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl<
|
||||
_$NewMessagesStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(int messagesCount) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(messagesCount);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(int messagesCount)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(messagesCount);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(int messagesCount)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(messagesCount);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value) $default, {
|
||||
required TResult Function(NewMessagesStateEmpty value) empty,
|
||||
required TResult Function(NewMessagesStateLoaded value) loaded,
|
||||
required TResult Function(NewMessagesStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NewMessagesState value)? $default, {
|
||||
TResult? Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult? Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult? Function(NewMessagesStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value)? $default, {
|
||||
TResult Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult Function(NewMessagesStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NewMessagesStateLoaded implements NewMessagesState {
|
||||
const factory NewMessagesStateLoaded({required final int messagesCount}) =
|
||||
_$NewMessagesStateLoadedImpl;
|
||||
|
||||
int get messagesCount;
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> {
|
||||
factory _$$NewMessagesStateErrorImplCopyWith(
|
||||
_$NewMessagesStateErrorImpl value,
|
||||
$Res Function(_$NewMessagesStateErrorImpl) then) =
|
||||
__$$NewMessagesStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NewMessagesStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl>
|
||||
implements _$$NewMessagesStateErrorImplCopyWith<$Res> {
|
||||
__$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value,
|
||||
$Res Function(_$NewMessagesStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$NewMessagesStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NewMessagesStateErrorImpl implements NewMessagesStateError {
|
||||
const _$NewMessagesStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NewMessagesState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NewMessagesStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
|
||||
get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl<
|
||||
_$NewMessagesStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(int messagesCount) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(int messagesCount)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(int messagesCount)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value) $default, {
|
||||
required TResult Function(NewMessagesStateEmpty value) empty,
|
||||
required TResult Function(NewMessagesStateLoaded value) loaded,
|
||||
required TResult Function(NewMessagesStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NewMessagesState value)? $default, {
|
||||
TResult? Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult? Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult? Function(NewMessagesStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NewMessagesState value)? $default, {
|
||||
TResult Function(NewMessagesStateEmpty value)? empty,
|
||||
TResult Function(NewMessagesStateLoaded value)? loaded,
|
||||
TResult Function(NewMessagesStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NewMessagesStateError implements NewMessagesState {
|
||||
const factory NewMessagesStateError({required final String errorMessage}) =
|
||||
_$NewMessagesStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of NewMessagesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,685 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'notifications_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NotificationsState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(
|
||||
List<String> notifications, int notificationsCount)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value) $default, {
|
||||
required TResult Function(NotificationsStateEmpty value) empty,
|
||||
required TResult Function(NotificationsStateLoaded value) loaded,
|
||||
required TResult Function(NotificationsStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NotificationsState value)? $default, {
|
||||
TResult? Function(NotificationsStateEmpty value)? empty,
|
||||
TResult? Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult? Function(NotificationsStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value)? $default, {
|
||||
TResult Function(NotificationsStateEmpty value)? empty,
|
||||
TResult Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult Function(NotificationsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NotificationsStateCopyWith<$Res> {
|
||||
factory $NotificationsStateCopyWith(
|
||||
NotificationsState value, $Res Function(NotificationsState) then) =
|
||||
_$NotificationsStateCopyWithImpl<$Res, NotificationsState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState>
|
||||
implements $NotificationsStateCopyWith<$Res> {
|
||||
_$NotificationsStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NotificationsStateImplCopyWith<$Res> {
|
||||
factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value,
|
||||
$Res Function(_$NotificationsStateImpl) then) =
|
||||
__$$NotificationsStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NotificationsStateImplCopyWithImpl<$Res>
|
||||
extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl>
|
||||
implements _$$NotificationsStateImplCopyWith<$Res> {
|
||||
__$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value,
|
||||
$Res Function(_$NotificationsStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NotificationsStateImpl implements _NotificationsState {
|
||||
const _$NotificationsStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NotificationsState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$NotificationsStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(
|
||||
List<String> notifications, int notificationsCount)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value) $default, {
|
||||
required TResult Function(NotificationsStateEmpty value) empty,
|
||||
required TResult Function(NotificationsStateLoaded value) loaded,
|
||||
required TResult Function(NotificationsStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NotificationsState value)? $default, {
|
||||
TResult? Function(NotificationsStateEmpty value)? empty,
|
||||
TResult? Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult? Function(NotificationsStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value)? $default, {
|
||||
TResult Function(NotificationsStateEmpty value)? empty,
|
||||
TResult Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult Function(NotificationsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _NotificationsState implements NotificationsState {
|
||||
const factory _NotificationsState() = _$NotificationsStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> {
|
||||
factory _$$NotificationsStateEmptyImplCopyWith(
|
||||
_$NotificationsStateEmptyImpl value,
|
||||
$Res Function(_$NotificationsStateEmptyImpl) then) =
|
||||
__$$NotificationsStateEmptyImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NotificationsStateEmptyImplCopyWithImpl<$Res>
|
||||
extends _$NotificationsStateCopyWithImpl<$Res,
|
||||
_$NotificationsStateEmptyImpl>
|
||||
implements _$$NotificationsStateEmptyImplCopyWith<$Res> {
|
||||
__$$NotificationsStateEmptyImplCopyWithImpl(
|
||||
_$NotificationsStateEmptyImpl _value,
|
||||
$Res Function(_$NotificationsStateEmptyImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty {
|
||||
const _$NotificationsStateEmptyImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NotificationsState.empty()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NotificationsStateEmptyImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(
|
||||
List<String> notifications, int notificationsCount)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return empty();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return empty?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (empty != null) {
|
||||
return empty();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value) $default, {
|
||||
required TResult Function(NotificationsStateEmpty value) empty,
|
||||
required TResult Function(NotificationsStateLoaded value) loaded,
|
||||
required TResult Function(NotificationsStateError value) error,
|
||||
}) {
|
||||
return empty(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NotificationsState value)? $default, {
|
||||
TResult? Function(NotificationsStateEmpty value)? empty,
|
||||
TResult? Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult? Function(NotificationsStateError value)? error,
|
||||
}) {
|
||||
return empty?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value)? $default, {
|
||||
TResult Function(NotificationsStateEmpty value)? empty,
|
||||
TResult Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult Function(NotificationsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (empty != null) {
|
||||
return empty(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NotificationsStateEmpty implements NotificationsState {
|
||||
const factory NotificationsStateEmpty() = _$NotificationsStateEmptyImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$NotificationsStateLoadedImplCopyWith(
|
||||
_$NotificationsStateLoadedImpl value,
|
||||
$Res Function(_$NotificationsStateLoadedImpl) then) =
|
||||
__$$NotificationsStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({List<String> notifications, int notificationsCount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NotificationsStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$NotificationsStateCopyWithImpl<$Res,
|
||||
_$NotificationsStateLoadedImpl>
|
||||
implements _$$NotificationsStateLoadedImplCopyWith<$Res> {
|
||||
__$$NotificationsStateLoadedImplCopyWithImpl(
|
||||
_$NotificationsStateLoadedImpl _value,
|
||||
$Res Function(_$NotificationsStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? notifications = null,
|
||||
Object? notificationsCount = null,
|
||||
}) {
|
||||
return _then(_$NotificationsStateLoadedImpl(
|
||||
notifications: null == notifications
|
||||
? _value._notifications
|
||||
: notifications // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
notificationsCount: null == notificationsCount
|
||||
? _value.notificationsCount
|
||||
: notificationsCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
|
||||
const _$NotificationsStateLoadedImpl(
|
||||
{required final List<String> notifications,
|
||||
required this.notificationsCount})
|
||||
: _notifications = notifications;
|
||||
|
||||
final List<String> _notifications;
|
||||
@override
|
||||
List<String> get notifications {
|
||||
if (_notifications is EqualUnmodifiableListView) return _notifications;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_notifications);
|
||||
}
|
||||
|
||||
@override
|
||||
final int notificationsCount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NotificationsState.loaded(notifications: $notifications, notificationsCount: $notificationsCount)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NotificationsStateLoadedImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._notifications, _notifications) &&
|
||||
(identical(other.notificationsCount, notificationsCount) ||
|
||||
other.notificationsCount == notificationsCount));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,
|
||||
const DeepCollectionEquality().hash(_notifications), notificationsCount);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
|
||||
get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl<
|
||||
_$NotificationsStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(
|
||||
List<String> notifications, int notificationsCount)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(notifications, notificationsCount);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(notifications, notificationsCount);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(notifications, notificationsCount);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value) $default, {
|
||||
required TResult Function(NotificationsStateEmpty value) empty,
|
||||
required TResult Function(NotificationsStateLoaded value) loaded,
|
||||
required TResult Function(NotificationsStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NotificationsState value)? $default, {
|
||||
TResult? Function(NotificationsStateEmpty value)? empty,
|
||||
TResult? Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult? Function(NotificationsStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value)? $default, {
|
||||
TResult Function(NotificationsStateEmpty value)? empty,
|
||||
TResult Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult Function(NotificationsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NotificationsStateLoaded implements NotificationsState {
|
||||
const factory NotificationsStateLoaded(
|
||||
{required final List<String> notifications,
|
||||
required final int notificationsCount}) = _$NotificationsStateLoadedImpl;
|
||||
|
||||
List<String> get notifications;
|
||||
int get notificationsCount;
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NotificationsStateErrorImplCopyWith<$Res> {
|
||||
factory _$$NotificationsStateErrorImplCopyWith(
|
||||
_$NotificationsStateErrorImpl value,
|
||||
$Res Function(_$NotificationsStateErrorImpl) then) =
|
||||
__$$NotificationsStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NotificationsStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$NotificationsStateCopyWithImpl<$Res,
|
||||
_$NotificationsStateErrorImpl>
|
||||
implements _$$NotificationsStateErrorImplCopyWith<$Res> {
|
||||
__$$NotificationsStateErrorImplCopyWithImpl(
|
||||
_$NotificationsStateErrorImpl _value,
|
||||
$Res Function(_$NotificationsStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$NotificationsStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$NotificationsStateErrorImpl implements NotificationsStateError {
|
||||
const _$NotificationsStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NotificationsState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NotificationsStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
|
||||
get copyWith => __$$NotificationsStateErrorImplCopyWithImpl<
|
||||
_$NotificationsStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() empty,
|
||||
required TResult Function(
|
||||
List<String> notifications, int notificationsCount)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? empty,
|
||||
TResult? Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? empty,
|
||||
TResult Function(List<String> notifications, int notificationsCount)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value) $default, {
|
||||
required TResult Function(NotificationsStateEmpty value) empty,
|
||||
required TResult Function(NotificationsStateLoaded value) loaded,
|
||||
required TResult Function(NotificationsStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_NotificationsState value)? $default, {
|
||||
TResult? Function(NotificationsStateEmpty value)? empty,
|
||||
TResult? Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult? Function(NotificationsStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_NotificationsState value)? $default, {
|
||||
TResult Function(NotificationsStateEmpty value)? empty,
|
||||
TResult Function(NotificationsStateLoaded value)? loaded,
|
||||
TResult Function(NotificationsStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class NotificationsStateError implements NotificationsState {
|
||||
const factory NotificationsStateError({required final String errorMessage}) =
|
||||
_$NotificationsStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of NotificationsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,655 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'profile_avatar_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProfileAvatarState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileModel profile) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileModel profile)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileModel profile)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value) $default, {
|
||||
required TResult Function(ProfileAvatarStateLoading value) loading,
|
||||
required TResult Function(ProfileAvatarStateLoaded value) loaded,
|
||||
required TResult Function(ProfileAvatarStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileAvatarState value)? $default, {
|
||||
TResult? Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileAvatarStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value)? $default, {
|
||||
TResult Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult Function(ProfileAvatarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProfileAvatarStateCopyWith<$Res> {
|
||||
factory $ProfileAvatarStateCopyWith(
|
||||
ProfileAvatarState value, $Res Function(ProfileAvatarState) then) =
|
||||
_$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState>
|
||||
implements $ProfileAvatarStateCopyWith<$Res> {
|
||||
_$ProfileAvatarStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileAvatarStateImplCopyWith<$Res> {
|
||||
factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value,
|
||||
$Res Function(_$ProfileAvatarStateImpl) then) =
|
||||
__$$ProfileAvatarStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileAvatarStateImplCopyWithImpl<$Res>
|
||||
extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl>
|
||||
implements _$$ProfileAvatarStateImplCopyWith<$Res> {
|
||||
__$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value,
|
||||
$Res Function(_$ProfileAvatarStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileAvatarStateImpl implements _ProfileAvatarState {
|
||||
const _$ProfileAvatarStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileAvatarState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileModel profile) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileModel profile)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileModel profile)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value) $default, {
|
||||
required TResult Function(ProfileAvatarStateLoading value) loading,
|
||||
required TResult Function(ProfileAvatarStateLoaded value) loaded,
|
||||
required TResult Function(ProfileAvatarStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileAvatarState value)? $default, {
|
||||
TResult? Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileAvatarStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value)? $default, {
|
||||
TResult Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult Function(ProfileAvatarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ProfileAvatarState implements ProfileAvatarState {
|
||||
const factory _ProfileAvatarState() = _$ProfileAvatarStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$ProfileAvatarStateLoadingImplCopyWith(
|
||||
_$ProfileAvatarStateLoadingImpl value,
|
||||
$Res Function(_$ProfileAvatarStateLoadingImpl) then) =
|
||||
__$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$ProfileAvatarStateCopyWithImpl<$Res,
|
||||
_$ProfileAvatarStateLoadingImpl>
|
||||
implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> {
|
||||
__$$ProfileAvatarStateLoadingImplCopyWithImpl(
|
||||
_$ProfileAvatarStateLoadingImpl _value,
|
||||
$Res Function(_$ProfileAvatarStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileAvatarStateLoadingImpl implements ProfileAvatarStateLoading {
|
||||
const _$ProfileAvatarStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileAvatarState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileAvatarStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileModel profile) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileModel profile)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileModel profile)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value) $default, {
|
||||
required TResult Function(ProfileAvatarStateLoading value) loading,
|
||||
required TResult Function(ProfileAvatarStateLoaded value) loaded,
|
||||
required TResult Function(ProfileAvatarStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileAvatarState value)? $default, {
|
||||
TResult? Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileAvatarStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value)? $default, {
|
||||
TResult Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult Function(ProfileAvatarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileAvatarStateLoading implements ProfileAvatarState {
|
||||
const factory ProfileAvatarStateLoading() = _$ProfileAvatarStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$ProfileAvatarStateLoadedImplCopyWith(
|
||||
_$ProfileAvatarStateLoadedImpl value,
|
||||
$Res Function(_$ProfileAvatarStateLoadedImpl) then) =
|
||||
__$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({ProfileModel profile});
|
||||
|
||||
$ProfileModelCopyWith<$Res> get profile;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$ProfileAvatarStateCopyWithImpl<$Res,
|
||||
_$ProfileAvatarStateLoadedImpl>
|
||||
implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> {
|
||||
__$$ProfileAvatarStateLoadedImplCopyWithImpl(
|
||||
_$ProfileAvatarStateLoadedImpl _value,
|
||||
$Res Function(_$ProfileAvatarStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? profile = null,
|
||||
}) {
|
||||
return _then(_$ProfileAvatarStateLoadedImpl(
|
||||
profile: null == profile
|
||||
? _value.profile
|
||||
: profile // ignore: cast_nullable_to_non_nullable
|
||||
as ProfileModel,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ProfileModelCopyWith<$Res> get profile {
|
||||
return $ProfileModelCopyWith<$Res>(_value.profile, (value) {
|
||||
return _then(_value.copyWith(profile: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded {
|
||||
const _$ProfileAvatarStateLoadedImpl({required this.profile});
|
||||
|
||||
@override
|
||||
final ProfileModel profile;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileAvatarState.loaded(profile: $profile)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileAvatarStateLoadedImpl &&
|
||||
(identical(other.profile, profile) || other.profile == profile));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, profile);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
|
||||
get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl<
|
||||
_$ProfileAvatarStateLoadedImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileModel profile) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(profile);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileModel profile)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(profile);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileModel profile)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(profile);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value) $default, {
|
||||
required TResult Function(ProfileAvatarStateLoading value) loading,
|
||||
required TResult Function(ProfileAvatarStateLoaded value) loaded,
|
||||
required TResult Function(ProfileAvatarStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileAvatarState value)? $default, {
|
||||
TResult? Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileAvatarStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value)? $default, {
|
||||
TResult Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult Function(ProfileAvatarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileAvatarStateLoaded implements ProfileAvatarState {
|
||||
const factory ProfileAvatarStateLoaded(
|
||||
{required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl;
|
||||
|
||||
ProfileModel get profile;
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> {
|
||||
factory _$$ProfileAvatarStateErrorImplCopyWith(
|
||||
_$ProfileAvatarStateErrorImpl value,
|
||||
$Res Function(_$ProfileAvatarStateErrorImpl) then) =
|
||||
__$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$ProfileAvatarStateCopyWithImpl<$Res,
|
||||
_$ProfileAvatarStateErrorImpl>
|
||||
implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> {
|
||||
__$$ProfileAvatarStateErrorImplCopyWithImpl(
|
||||
_$ProfileAvatarStateErrorImpl _value,
|
||||
$Res Function(_$ProfileAvatarStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$ProfileAvatarStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError {
|
||||
const _$ProfileAvatarStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProfileAvatarState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProfileAvatarStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
|
||||
get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl<
|
||||
_$ProfileAvatarStateErrorImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(ProfileModel profile) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(ProfileModel profile)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(ProfileModel profile)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value) $default, {
|
||||
required TResult Function(ProfileAvatarStateLoading value) loading,
|
||||
required TResult Function(ProfileAvatarStateLoaded value) loaded,
|
||||
required TResult Function(ProfileAvatarStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ProfileAvatarState value)? $default, {
|
||||
TResult? Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult? Function(ProfileAvatarStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ProfileAvatarState value)? $default, {
|
||||
TResult Function(ProfileAvatarStateLoading value)? loading,
|
||||
TResult Function(ProfileAvatarStateLoaded value)? loaded,
|
||||
TResult Function(ProfileAvatarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ProfileAvatarStateError implements ProfileAvatarState {
|
||||
const factory ProfileAvatarStateError({required final String errorMessage}) =
|
||||
_$ProfileAvatarStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of ProfileAvatarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'calendar_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
CalendarModel _$CalendarModelFromJson(Map<String, dynamic> json) {
|
||||
return _CalendarModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CalendarModel {
|
||||
String get date => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
bool get isCurrentDayIncludedInTheChosenDietProgression =>
|
||||
throw _privateConstructorUsedError;
|
||||
Object? get diary => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CalendarModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CalendarModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CalendarModelCopyWith<CalendarModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CalendarModelCopyWith<$Res> {
|
||||
factory $CalendarModelCopyWith(
|
||||
CalendarModel value, $Res Function(CalendarModel) then) =
|
||||
_$CalendarModelCopyWithImpl<$Res, CalendarModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String date,
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
bool isCurrentDayIncludedInTheChosenDietProgression,
|
||||
Object? diary});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
|
||||
implements $CalendarModelCopyWith<$Res> {
|
||||
_$CalendarModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CalendarModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? isCurrentDayIncludedInTheChosenDietProgression = null,
|
||||
Object? diary = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isCurrentDayIncludedInTheChosenDietProgression: null ==
|
||||
isCurrentDayIncludedInTheChosenDietProgression
|
||||
? _value.isCurrentDayIncludedInTheChosenDietProgression
|
||||
: isCurrentDayIncludedInTheChosenDietProgression // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diary: freezed == diary ? _value.diary : diary,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CalendarModelImplCopyWith<$Res>
|
||||
implements $CalendarModelCopyWith<$Res> {
|
||||
factory _$$CalendarModelImplCopyWith(
|
||||
_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) =
|
||||
__$$CalendarModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String date,
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
bool isCurrentDayIncludedInTheChosenDietProgression,
|
||||
Object? diary});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CalendarModelImplCopyWithImpl<$Res>
|
||||
extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl>
|
||||
implements _$$CalendarModelImplCopyWith<$Res> {
|
||||
__$$CalendarModelImplCopyWithImpl(
|
||||
_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CalendarModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? isCurrentDayIncludedInTheChosenDietProgression = null,
|
||||
Object? diary = freezed,
|
||||
}) {
|
||||
return _then(_$CalendarModelImpl(
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isCurrentDayIncludedInTheChosenDietProgression: null ==
|
||||
isCurrentDayIncludedInTheChosenDietProgression
|
||||
? _value.isCurrentDayIncludedInTheChosenDietProgression
|
||||
: isCurrentDayIncludedInTheChosenDietProgression // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
diary: freezed == diary ? _value.diary : diary,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CalendarModelImpl implements _CalendarModel {
|
||||
const _$CalendarModelImpl(
|
||||
{required this.date,
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
required this.isCurrentDayIncludedInTheChosenDietProgression,
|
||||
this.diary});
|
||||
|
||||
factory _$CalendarModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CalendarModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String date;
|
||||
@override
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
final bool isCurrentDayIncludedInTheChosenDietProgression;
|
||||
@override
|
||||
final Object? diary;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarModel(date: $date, isCurrentDayIncludedInTheChosenDietProgression: $isCurrentDayIncludedInTheChosenDietProgression, diary: $diary)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CalendarModelImpl &&
|
||||
(identical(other.date, date) || other.date == date) &&
|
||||
(identical(other.isCurrentDayIncludedInTheChosenDietProgression,
|
||||
isCurrentDayIncludedInTheChosenDietProgression) ||
|
||||
other.isCurrentDayIncludedInTheChosenDietProgression ==
|
||||
isCurrentDayIncludedInTheChosenDietProgression) &&
|
||||
const DeepCollectionEquality().equals(other.diary, diary));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
date,
|
||||
isCurrentDayIncludedInTheChosenDietProgression,
|
||||
const DeepCollectionEquality().hash(diary));
|
||||
|
||||
/// Create a copy of CalendarModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith =>
|
||||
__$$CalendarModelImplCopyWithImpl<_$CalendarModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CalendarModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CalendarModel implements CalendarModel {
|
||||
const factory _CalendarModel(
|
||||
{required final String date,
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
required final bool isCurrentDayIncludedInTheChosenDietProgression,
|
||||
final Object? diary}) = _$CalendarModelImpl;
|
||||
|
||||
factory _CalendarModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CalendarModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get date;
|
||||
@override
|
||||
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
|
||||
bool get isCurrentDayIncludedInTheChosenDietProgression;
|
||||
@override
|
||||
Object? get diary;
|
||||
|
||||
/// Create a copy of CalendarModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'calendar_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CalendarModelImpl _$$CalendarModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CalendarModelImpl(
|
||||
date: json['date'] as String,
|
||||
isCurrentDayIncludedInTheChosenDietProgression:
|
||||
json['is_current_day_included_in_the_chosen_diet_progression']
|
||||
as bool,
|
||||
diary: json['diary'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CalendarModelImplToJson(_$CalendarModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'is_current_day_included_in_the_chosen_diet_progression':
|
||||
instance.isCurrentDayIncludedInTheChosenDietProgression,
|
||||
'diary': instance.diary,
|
||||
};
|
||||
@@ -1,644 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'calendar_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CalendarState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<CalendarModel> calendarList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default, {
|
||||
required TResult Function(CalendarStateLoading value) loading,
|
||||
required TResult Function(CalendarStateLoaded value) loaded,
|
||||
required TResult Function(CalendarStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default, {
|
||||
TResult? Function(CalendarStateLoading value)? loading,
|
||||
TResult? Function(CalendarStateLoaded value)? loaded,
|
||||
TResult? Function(CalendarStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
TResult Function(CalendarStateLoading value)? loading,
|
||||
TResult Function(CalendarStateLoaded value)? loaded,
|
||||
TResult Function(CalendarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CalendarStateCopyWith<$Res> {
|
||||
factory $CalendarStateCopyWith(
|
||||
CalendarState value, $Res Function(CalendarState) then) =
|
||||
_$CalendarStateCopyWithImpl<$Res, CalendarState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState>
|
||||
implements $CalendarStateCopyWith<$Res> {
|
||||
_$CalendarStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CalendarStateImplCopyWith<$Res> {
|
||||
factory _$$CalendarStateImplCopyWith(
|
||||
_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) =
|
||||
__$$CalendarStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CalendarStateImplCopyWithImpl<$Res>
|
||||
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl>
|
||||
implements _$$CalendarStateImplCopyWith<$Res> {
|
||||
__$$CalendarStateImplCopyWithImpl(
|
||||
_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CalendarStateImpl implements _CalendarState {
|
||||
const _$CalendarStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$CalendarStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<CalendarModel> calendarList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default, {
|
||||
required TResult Function(CalendarStateLoading value) loading,
|
||||
required TResult Function(CalendarStateLoaded value) loaded,
|
||||
required TResult Function(CalendarStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default, {
|
||||
TResult? Function(CalendarStateLoading value)? loading,
|
||||
TResult? Function(CalendarStateLoaded value)? loaded,
|
||||
TResult? Function(CalendarStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
TResult Function(CalendarStateLoading value)? loading,
|
||||
TResult Function(CalendarStateLoaded value)? loaded,
|
||||
TResult Function(CalendarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CalendarState implements CalendarState {
|
||||
const factory _CalendarState() = _$CalendarStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CalendarStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value,
|
||||
$Res Function(_$CalendarStateLoadingImpl) then) =
|
||||
__$$CalendarStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CalendarStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl>
|
||||
implements _$$CalendarStateLoadingImplCopyWith<$Res> {
|
||||
__$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value,
|
||||
$Res Function(_$CalendarStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CalendarStateLoadingImpl implements CalendarStateLoading {
|
||||
const _$CalendarStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CalendarStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<CalendarModel> calendarList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default, {
|
||||
required TResult Function(CalendarStateLoading value) loading,
|
||||
required TResult Function(CalendarStateLoaded value) loaded,
|
||||
required TResult Function(CalendarStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default, {
|
||||
TResult? Function(CalendarStateLoading value)? loading,
|
||||
TResult? Function(CalendarStateLoaded value)? loaded,
|
||||
TResult? Function(CalendarStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
TResult Function(CalendarStateLoading value)? loading,
|
||||
TResult Function(CalendarStateLoaded value)? loaded,
|
||||
TResult Function(CalendarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CalendarStateLoading implements CalendarState {
|
||||
const factory CalendarStateLoading() = _$CalendarStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CalendarStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value,
|
||||
$Res Function(_$CalendarStateLoadedImpl) then) =
|
||||
__$$CalendarStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({List<CalendarModel> calendarList});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CalendarStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl>
|
||||
implements _$$CalendarStateLoadedImplCopyWith<$Res> {
|
||||
__$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value,
|
||||
$Res Function(_$CalendarStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? calendarList = null,
|
||||
}) {
|
||||
return _then(_$CalendarStateLoadedImpl(
|
||||
calendarList: null == calendarList
|
||||
? _value._calendarList
|
||||
: calendarList // ignore: cast_nullable_to_non_nullable
|
||||
as List<CalendarModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
|
||||
const _$CalendarStateLoadedImpl(
|
||||
{required final List<CalendarModel> calendarList})
|
||||
: _calendarList = calendarList;
|
||||
|
||||
final List<CalendarModel> _calendarList;
|
||||
@override
|
||||
List<CalendarModel> get calendarList {
|
||||
if (_calendarList is EqualUnmodifiableListView) return _calendarList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_calendarList);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState.loaded(calendarList: $calendarList)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CalendarStateLoadedImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._calendarList, _calendarList));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_calendarList));
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith =>
|
||||
__$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<CalendarModel> calendarList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(calendarList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(calendarList);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(calendarList);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default, {
|
||||
required TResult Function(CalendarStateLoading value) loading,
|
||||
required TResult Function(CalendarStateLoaded value) loaded,
|
||||
required TResult Function(CalendarStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default, {
|
||||
TResult? Function(CalendarStateLoading value)? loading,
|
||||
TResult? Function(CalendarStateLoaded value)? loaded,
|
||||
TResult? Function(CalendarStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
TResult Function(CalendarStateLoading value)? loading,
|
||||
TResult Function(CalendarStateLoaded value)? loaded,
|
||||
TResult Function(CalendarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CalendarStateLoaded implements CalendarState {
|
||||
const factory CalendarStateLoaded(
|
||||
{required final List<CalendarModel> calendarList}) =
|
||||
_$CalendarStateLoadedImpl;
|
||||
|
||||
List<CalendarModel> get calendarList;
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CalendarStateErrorImplCopyWith<$Res> {
|
||||
factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value,
|
||||
$Res Function(_$CalendarStateErrorImpl) then) =
|
||||
__$$CalendarStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CalendarStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl>
|
||||
implements _$$CalendarStateErrorImplCopyWith<$Res> {
|
||||
__$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value,
|
||||
$Res Function(_$CalendarStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$CalendarStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CalendarStateErrorImpl implements CalendarStateError {
|
||||
const _$CalendarStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CalendarState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CalendarStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith =>
|
||||
__$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(List<CalendarModel> calendarList) loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(List<CalendarModel> calendarList)? loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value) $default, {
|
||||
required TResult Function(CalendarStateLoading value) loading,
|
||||
required TResult Function(CalendarStateLoaded value) loaded,
|
||||
required TResult Function(CalendarStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_CalendarState value)? $default, {
|
||||
TResult? Function(CalendarStateLoading value)? loading,
|
||||
TResult? Function(CalendarStateLoaded value)? loaded,
|
||||
TResult? Function(CalendarStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_CalendarState value)? $default, {
|
||||
TResult Function(CalendarStateLoading value)? loading,
|
||||
TResult Function(CalendarStateLoaded value)? loaded,
|
||||
TResult Function(CalendarStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CalendarStateError implements CalendarState {
|
||||
const factory CalendarStateError({required final String errorMessage}) =
|
||||
_$CalendarStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of CalendarState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'calendar_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _CalendarService implements CalendarService {
|
||||
_CalendarService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<List<CalendarModel>> getCalendar() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<CalendarModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/calendar/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<CalendarModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) => CalendarModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_message_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatMessageModel _$ChatMessageModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChatMessageModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatMessageModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get data => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'media_data')
|
||||
List<dynamic>? get mediaData => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'author_id')
|
||||
int get authorId => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate)
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false)
|
||||
bool get isRead => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_author_message_auth_user')
|
||||
bool? get isCurrentUserAuthor => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'room_id')
|
||||
String? get roomId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatMessageModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatMessageModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatMessageModelCopyWith<ChatMessageModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatMessageModelCopyWith<$Res> {
|
||||
factory $ChatMessageModelCopyWith(
|
||||
ChatMessageModel value, $Res Function(ChatMessageModel) then) =
|
||||
_$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String data,
|
||||
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
|
||||
@JsonKey(name: 'author_id') int authorId,
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
|
||||
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
|
||||
@JsonKey(name: 'room_id') String? roomId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel>
|
||||
implements $ChatMessageModelCopyWith<$Res> {
|
||||
_$ChatMessageModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatMessageModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? data = null,
|
||||
Object? mediaData = freezed,
|
||||
Object? authorId = null,
|
||||
Object? updatedAt = null,
|
||||
Object? isRead = null,
|
||||
Object? isCurrentUserAuthor = freezed,
|
||||
Object? roomId = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
data: null == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
mediaData: freezed == mediaData
|
||||
? _value.mediaData
|
||||
: mediaData // ignore: cast_nullable_to_non_nullable
|
||||
as List<dynamic>?,
|
||||
authorId: null == authorId
|
||||
? _value.authorId
|
||||
: authorId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
isRead: null == isRead
|
||||
? _value.isRead
|
||||
: isRead // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCurrentUserAuthor: freezed == isCurrentUserAuthor
|
||||
? _value.isCurrentUserAuthor
|
||||
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
roomId: freezed == roomId
|
||||
? _value.roomId
|
||||
: roomId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatMessageModelImplCopyWith<$Res>
|
||||
implements $ChatMessageModelCopyWith<$Res> {
|
||||
factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value,
|
||||
$Res Function(_$ChatMessageModelImpl) then) =
|
||||
__$$ChatMessageModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String data,
|
||||
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
|
||||
@JsonKey(name: 'author_id') int authorId,
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
|
||||
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
|
||||
@JsonKey(name: 'room_id') String? roomId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatMessageModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl>
|
||||
implements _$$ChatMessageModelImplCopyWith<$Res> {
|
||||
__$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value,
|
||||
$Res Function(_$ChatMessageModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatMessageModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? data = null,
|
||||
Object? mediaData = freezed,
|
||||
Object? authorId = null,
|
||||
Object? updatedAt = null,
|
||||
Object? isRead = null,
|
||||
Object? isCurrentUserAuthor = freezed,
|
||||
Object? roomId = freezed,
|
||||
}) {
|
||||
return _then(_$ChatMessageModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
data: null == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
mediaData: freezed == mediaData
|
||||
? _value._mediaData
|
||||
: mediaData // ignore: cast_nullable_to_non_nullable
|
||||
as List<dynamic>?,
|
||||
authorId: null == authorId
|
||||
? _value.authorId
|
||||
: authorId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
isRead: null == isRead
|
||||
? _value.isRead
|
||||
: isRead // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isCurrentUserAuthor: freezed == isCurrentUserAuthor
|
||||
? _value.isCurrentUserAuthor
|
||||
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
roomId: freezed == roomId
|
||||
? _value.roomId
|
||||
: roomId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatMessageModelImpl implements _ChatMessageModel {
|
||||
const _$ChatMessageModelImpl(
|
||||
{required this.id,
|
||||
required this.data,
|
||||
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
|
||||
@JsonKey(name: 'author_id') required this.authorId,
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate) required this.updatedAt,
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false)
|
||||
required this.isRead,
|
||||
@JsonKey(name: 'is_author_message_auth_user')
|
||||
required this.isCurrentUserAuthor,
|
||||
@JsonKey(name: 'room_id') required this.roomId})
|
||||
: _mediaData = mediaData;
|
||||
|
||||
factory _$ChatMessageModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatMessageModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String data;
|
||||
final List<dynamic>? _mediaData;
|
||||
@override
|
||||
@JsonKey(name: 'media_data')
|
||||
List<dynamic>? get mediaData {
|
||||
final value = _mediaData;
|
||||
if (value == null) return null;
|
||||
if (_mediaData is EqualUnmodifiableListView) return _mediaData;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'author_id')
|
||||
final int authorId;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate)
|
||||
final DateTime updatedAt;
|
||||
@override
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false)
|
||||
final bool isRead;
|
||||
@override
|
||||
@JsonKey(name: 'is_author_message_auth_user')
|
||||
final bool? isCurrentUserAuthor;
|
||||
@override
|
||||
@JsonKey(name: 'room_id')
|
||||
final String? roomId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatMessageModel(id: $id, data: $data, mediaData: $mediaData, authorId: $authorId, updatedAt: $updatedAt, isRead: $isRead, isCurrentUserAuthor: $isCurrentUserAuthor, roomId: $roomId)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatMessageModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.data, data) || other.data == data) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._mediaData, _mediaData) &&
|
||||
(identical(other.authorId, authorId) ||
|
||||
other.authorId == authorId) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.isRead, isRead) || other.isRead == isRead) &&
|
||||
(identical(other.isCurrentUserAuthor, isCurrentUserAuthor) ||
|
||||
other.isCurrentUserAuthor == isCurrentUserAuthor) &&
|
||||
(identical(other.roomId, roomId) || other.roomId == roomId));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
data,
|
||||
const DeepCollectionEquality().hash(_mediaData),
|
||||
authorId,
|
||||
updatedAt,
|
||||
isRead,
|
||||
isCurrentUserAuthor,
|
||||
roomId);
|
||||
|
||||
/// Create a copy of ChatMessageModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith =>
|
||||
__$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatMessageModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatMessageModel implements ChatMessageModel {
|
||||
const factory _ChatMessageModel(
|
||||
{required final int id,
|
||||
required final String data,
|
||||
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
|
||||
@JsonKey(name: 'author_id') required final int authorId,
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate)
|
||||
required final DateTime updatedAt,
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false)
|
||||
required final bool isRead,
|
||||
@JsonKey(name: 'is_author_message_auth_user')
|
||||
required final bool? isCurrentUserAuthor,
|
||||
@JsonKey(name: 'room_id') required final String? roomId}) =
|
||||
_$ChatMessageModelImpl;
|
||||
|
||||
factory _ChatMessageModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatMessageModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get data;
|
||||
@override
|
||||
@JsonKey(name: 'media_data')
|
||||
List<dynamic>? get mediaData;
|
||||
@override
|
||||
@JsonKey(name: 'author_id')
|
||||
int get authorId;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at', fromJson: parseDate)
|
||||
DateTime get updatedAt;
|
||||
@override
|
||||
@JsonKey(name: 'read_by_to_user', defaultValue: false)
|
||||
bool get isRead;
|
||||
@override
|
||||
@JsonKey(name: 'is_author_message_auth_user')
|
||||
bool? get isCurrentUserAuthor;
|
||||
@override
|
||||
@JsonKey(name: 'room_id')
|
||||
String? get roomId;
|
||||
|
||||
/// Create a copy of ChatMessageModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_message_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChatMessageModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
data: json['data'] as String,
|
||||
mediaData: json['media_data'] as List<dynamic>?,
|
||||
authorId: (json['author_id'] as num).toInt(),
|
||||
updatedAt: parseDate(json['updated_at'] as String),
|
||||
isRead: json['read_by_to_user'] as bool? ?? false,
|
||||
isCurrentUserAuthor: json['is_author_message_auth_user'] as bool?,
|
||||
roomId: json['room_id'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatMessageModelImplToJson(
|
||||
_$ChatMessageModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'data': instance.data,
|
||||
'media_data': instance.mediaData,
|
||||
'author_id': instance.authorId,
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
'read_by_to_user': instance.isRead,
|
||||
'is_author_message_auth_user': instance.isCurrentUserAuthor,
|
||||
'room_id': instance.roomId,
|
||||
};
|
||||
@@ -1,218 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_messages_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatMessagesModel _$ChatMessagesModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChatMessagesModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatMessagesModel {
|
||||
@JsonKey(name: 'data')
|
||||
List<ChatMessageModel> get messagesList => throw _privateConstructorUsedError;
|
||||
ChatMetaModel get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatMessagesModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatMessagesModelCopyWith<ChatMessagesModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatMessagesModelCopyWith<$Res> {
|
||||
factory $ChatMessagesModelCopyWith(
|
||||
ChatMessagesModel value, $Res Function(ChatMessagesModel) then) =
|
||||
_$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
|
||||
ChatMetaModel meta});
|
||||
|
||||
$ChatMetaModelCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel>
|
||||
implements $ChatMessagesModelCopyWith<$Res> {
|
||||
_$ChatMessagesModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? messagesList = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
messagesList: null == messagesList
|
||||
? _value.messagesList
|
||||
: messagesList // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChatMessageModel>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as ChatMetaModel,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChatMetaModelCopyWith<$Res> get meta {
|
||||
return $ChatMetaModelCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatMessagesModelImplCopyWith<$Res>
|
||||
implements $ChatMessagesModelCopyWith<$Res> {
|
||||
factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value,
|
||||
$Res Function(_$ChatMessagesModelImpl) then) =
|
||||
__$$ChatMessagesModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
|
||||
ChatMetaModel meta});
|
||||
|
||||
@override
|
||||
$ChatMetaModelCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatMessagesModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl>
|
||||
implements _$$ChatMessagesModelImplCopyWith<$Res> {
|
||||
__$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value,
|
||||
$Res Function(_$ChatMessagesModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? messagesList = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$ChatMessagesModelImpl(
|
||||
messagesList: null == messagesList
|
||||
? _value._messagesList
|
||||
: messagesList // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChatMessageModel>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as ChatMetaModel,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatMessagesModelImpl implements _ChatMessagesModel {
|
||||
const _$ChatMessagesModelImpl(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<ChatMessageModel> messagesList,
|
||||
required this.meta})
|
||||
: _messagesList = messagesList;
|
||||
|
||||
factory _$ChatMessagesModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatMessagesModelImplFromJson(json);
|
||||
|
||||
final List<ChatMessageModel> _messagesList;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ChatMessageModel> get messagesList {
|
||||
if (_messagesList is EqualUnmodifiableListView) return _messagesList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_messagesList);
|
||||
}
|
||||
|
||||
@override
|
||||
final ChatMetaModel meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatMessagesModel(messagesList: $messagesList, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatMessagesModelImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._messagesList, _messagesList) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_messagesList), meta);
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith =>
|
||||
__$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatMessagesModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatMessagesModel implements ChatMessagesModel {
|
||||
const factory _ChatMessagesModel(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<ChatMessageModel> messagesList,
|
||||
required final ChatMetaModel meta}) = _$ChatMessagesModelImpl;
|
||||
|
||||
factory _ChatMessagesModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatMessagesModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<ChatMessageModel> get messagesList;
|
||||
@override
|
||||
ChatMetaModel get meta;
|
||||
|
||||
/// Create a copy of ChatMessagesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_messages_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChatMessagesModelImpl(
|
||||
messagesList: (json['data'] as List<dynamic>)
|
||||
.map((e) => ChatMessageModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
meta: ChatMetaModel.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatMessagesModelImplToJson(
|
||||
_$ChatMessagesModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.messagesList,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
@@ -1,171 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_meta_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatMetaModel _$ChatMetaModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChatMetaModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatMetaModel {
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatMetaModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatMetaModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatMetaModelCopyWith<ChatMetaModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatMetaModelCopyWith<$Res> {
|
||||
factory $ChatMetaModelCopyWith(
|
||||
ChatMetaModel value, $Res Function(ChatMetaModel) then) =
|
||||
_$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: "last_page") int lastPage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel>
|
||||
implements $ChatMetaModelCopyWith<$Res> {
|
||||
_$ChatMetaModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatMetaModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? lastPage = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
lastPage: null == lastPage
|
||||
? _value.lastPage
|
||||
: lastPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatMetaModelImplCopyWith<$Res>
|
||||
implements $ChatMetaModelCopyWith<$Res> {
|
||||
factory _$$ChatMetaModelImplCopyWith(
|
||||
_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) =
|
||||
__$$ChatMetaModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: "last_page") int lastPage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatMetaModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl>
|
||||
implements _$$ChatMetaModelImplCopyWith<$Res> {
|
||||
__$$ChatMetaModelImplCopyWithImpl(
|
||||
_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatMetaModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? lastPage = null,
|
||||
}) {
|
||||
return _then(_$ChatMetaModelImpl(
|
||||
lastPage: null == lastPage
|
||||
? _value.lastPage
|
||||
: lastPage // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatMetaModelImpl implements _ChatMetaModel {
|
||||
const _$ChatMetaModelImpl(
|
||||
{@JsonKey(name: "last_page") required this.lastPage});
|
||||
|
||||
factory _$ChatMetaModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatMetaModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "last_page")
|
||||
final int lastPage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatMetaModel(lastPage: $lastPage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatMetaModelImpl &&
|
||||
(identical(other.lastPage, lastPage) ||
|
||||
other.lastPage == lastPage));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, lastPage);
|
||||
|
||||
/// Create a copy of ChatMetaModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith =>
|
||||
__$$ChatMetaModelImplCopyWithImpl<_$ChatMetaModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatMetaModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatMetaModel implements ChatMetaModel {
|
||||
const factory _ChatMetaModel(
|
||||
{@JsonKey(name: "last_page") required final int lastPage}) =
|
||||
_$ChatMetaModelImpl;
|
||||
|
||||
factory _ChatMetaModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatMetaModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "last_page")
|
||||
int get lastPage;
|
||||
|
||||
/// Create a copy of ChatMetaModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_meta_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatMetaModelImpl(
|
||||
lastPage: (json['last_page'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'last_page': instance.lastPage,
|
||||
};
|
||||
@@ -1,496 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_room_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatRoomModel _$ChatRoomModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChatRoomModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatRoomModel {
|
||||
String get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
ChatRoomSettingsModel get chatRoomSettings =>
|
||||
throw _privateConstructorUsedError;
|
||||
Users get users => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
ChosenPlanModel? get chosenPlan => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatRoomModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatRoomModelCopyWith<ChatRoomModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatRoomModelCopyWith<$Res> {
|
||||
factory $ChatRoomModelCopyWith(
|
||||
ChatRoomModel value, $Res Function(ChatRoomModel) then) =
|
||||
_$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
ChatRoomSettingsModel chatRoomSettings,
|
||||
Users users,
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
ChosenPlanModel? chosenPlan});
|
||||
|
||||
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings;
|
||||
$UsersCopyWith<$Res> get users;
|
||||
$ChosenPlanModelCopyWith<$Res>? get chosenPlan;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
|
||||
implements $ChatRoomModelCopyWith<$Res> {
|
||||
_$ChatRoomModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? chatRoomSettings = null,
|
||||
Object? users = null,
|
||||
Object? chosenPlan = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
chatRoomSettings: null == chatRoomSettings
|
||||
? _value.chatRoomSettings
|
||||
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
|
||||
as ChatRoomSettingsModel,
|
||||
users: null == users
|
||||
? _value.users
|
||||
: users // ignore: cast_nullable_to_non_nullable
|
||||
as Users,
|
||||
chosenPlan: freezed == chosenPlan
|
||||
? _value.chosenPlan
|
||||
: chosenPlan // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanModel?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings {
|
||||
return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings,
|
||||
(value) {
|
||||
return _then(_value.copyWith(chatRoomSettings: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UsersCopyWith<$Res> get users {
|
||||
return $UsersCopyWith<$Res>(_value.users, (value) {
|
||||
return _then(_value.copyWith(users: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChosenPlanModelCopyWith<$Res>? get chosenPlan {
|
||||
if (_value.chosenPlan == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ChosenPlanModelCopyWith<$Res>(_value.chosenPlan!, (value) {
|
||||
return _then(_value.copyWith(chosenPlan: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomModelImplCopyWith<$Res>
|
||||
implements $ChatRoomModelCopyWith<$Res> {
|
||||
factory _$$ChatRoomModelImplCopyWith(
|
||||
_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) =
|
||||
__$$ChatRoomModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
ChatRoomSettingsModel chatRoomSettings,
|
||||
Users users,
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
ChosenPlanModel? chosenPlan});
|
||||
|
||||
@override
|
||||
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings;
|
||||
@override
|
||||
$UsersCopyWith<$Res> get users;
|
||||
@override
|
||||
$ChosenPlanModelCopyWith<$Res>? get chosenPlan;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl>
|
||||
implements _$$ChatRoomModelImplCopyWith<$Res> {
|
||||
__$$ChatRoomModelImplCopyWithImpl(
|
||||
_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? chatRoomSettings = null,
|
||||
Object? users = null,
|
||||
Object? chosenPlan = freezed,
|
||||
}) {
|
||||
return _then(_$ChatRoomModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
chatRoomSettings: null == chatRoomSettings
|
||||
? _value.chatRoomSettings
|
||||
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
|
||||
as ChatRoomSettingsModel,
|
||||
users: null == users
|
||||
? _value.users
|
||||
: users // ignore: cast_nullable_to_non_nullable
|
||||
as Users,
|
||||
chosenPlan: freezed == chosenPlan
|
||||
? _value.chosenPlan
|
||||
: chosenPlan // ignore: cast_nullable_to_non_nullable
|
||||
as ChosenPlanModel?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatRoomModelImpl implements _ChatRoomModel {
|
||||
const _$ChatRoomModelImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'chat_room_setting') required this.chatRoomSettings,
|
||||
required this.users,
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
required this.chosenPlan});
|
||||
|
||||
factory _$ChatRoomModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatRoomModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String id;
|
||||
@override
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
final ChatRoomSettingsModel chatRoomSettings;
|
||||
@override
|
||||
final Users users;
|
||||
@override
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
final ChosenPlanModel? chosenPlan;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomModel(id: $id, chatRoomSettings: $chatRoomSettings, users: $users, chosenPlan: $chosenPlan)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatRoomModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.chatRoomSettings, chatRoomSettings) ||
|
||||
other.chatRoomSettings == chatRoomSettings) &&
|
||||
(identical(other.users, users) || other.users == users) &&
|
||||
(identical(other.chosenPlan, chosenPlan) ||
|
||||
other.chosenPlan == chosenPlan));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, chatRoomSettings, users, chosenPlan);
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith =>
|
||||
__$$ChatRoomModelImplCopyWithImpl<_$ChatRoomModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatRoomModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatRoomModel implements ChatRoomModel {
|
||||
const factory _ChatRoomModel(
|
||||
{required final String id,
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
required final ChatRoomSettingsModel chatRoomSettings,
|
||||
required final Users users,
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
required final ChosenPlanModel? chosenPlan}) = _$ChatRoomModelImpl;
|
||||
|
||||
factory _ChatRoomModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatRoomModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get id;
|
||||
@override
|
||||
@JsonKey(name: 'chat_room_setting')
|
||||
ChatRoomSettingsModel get chatRoomSettings;
|
||||
@override
|
||||
Users get users;
|
||||
@override
|
||||
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
|
||||
ChosenPlanModel? get chosenPlan;
|
||||
|
||||
/// Create a copy of ChatRoomModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Users _$UsersFromJson(Map<String, dynamic> json) {
|
||||
return _Users.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Users {
|
||||
@JsonKey(name: 'from_chat_user')
|
||||
ChatUserModel get sender => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'to_chat_user')
|
||||
ChatUserModel get receiver => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Users to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$UsersCopyWith<Users> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $UsersCopyWith<$Res> {
|
||||
factory $UsersCopyWith(Users value, $Res Function(Users) then) =
|
||||
_$UsersCopyWithImpl<$Res, Users>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'from_chat_user') ChatUserModel sender,
|
||||
@JsonKey(name: 'to_chat_user') ChatUserModel receiver});
|
||||
|
||||
$ChatUserModelCopyWith<$Res> get sender;
|
||||
$ChatUserModelCopyWith<$Res> get receiver;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$UsersCopyWithImpl<$Res, $Val extends Users>
|
||||
implements $UsersCopyWith<$Res> {
|
||||
_$UsersCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? sender = null,
|
||||
Object? receiver = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
sender: null == sender
|
||||
? _value.sender
|
||||
: sender // ignore: cast_nullable_to_non_nullable
|
||||
as ChatUserModel,
|
||||
receiver: null == receiver
|
||||
? _value.receiver
|
||||
: receiver // ignore: cast_nullable_to_non_nullable
|
||||
as ChatUserModel,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChatUserModelCopyWith<$Res> get sender {
|
||||
return $ChatUserModelCopyWith<$Res>(_value.sender, (value) {
|
||||
return _then(_value.copyWith(sender: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChatUserModelCopyWith<$Res> get receiver {
|
||||
return $ChatUserModelCopyWith<$Res>(_value.receiver, (value) {
|
||||
return _then(_value.copyWith(receiver: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> {
|
||||
factory _$$UsersImplCopyWith(
|
||||
_$UsersImpl value, $Res Function(_$UsersImpl) then) =
|
||||
__$$UsersImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'from_chat_user') ChatUserModel sender,
|
||||
@JsonKey(name: 'to_chat_user') ChatUserModel receiver});
|
||||
|
||||
@override
|
||||
$ChatUserModelCopyWith<$Res> get sender;
|
||||
@override
|
||||
$ChatUserModelCopyWith<$Res> get receiver;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$UsersImplCopyWithImpl<$Res>
|
||||
extends _$UsersCopyWithImpl<$Res, _$UsersImpl>
|
||||
implements _$$UsersImplCopyWith<$Res> {
|
||||
__$$UsersImplCopyWithImpl(
|
||||
_$UsersImpl _value, $Res Function(_$UsersImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? sender = null,
|
||||
Object? receiver = null,
|
||||
}) {
|
||||
return _then(_$UsersImpl(
|
||||
sender: null == sender
|
||||
? _value.sender
|
||||
: sender // ignore: cast_nullable_to_non_nullable
|
||||
as ChatUserModel,
|
||||
receiver: null == receiver
|
||||
? _value.receiver
|
||||
: receiver // ignore: cast_nullable_to_non_nullable
|
||||
as ChatUserModel,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$UsersImpl implements _Users {
|
||||
const _$UsersImpl(
|
||||
{@JsonKey(name: 'from_chat_user') required this.sender,
|
||||
@JsonKey(name: 'to_chat_user') required this.receiver});
|
||||
|
||||
factory _$UsersImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UsersImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'from_chat_user')
|
||||
final ChatUserModel sender;
|
||||
@override
|
||||
@JsonKey(name: 'to_chat_user')
|
||||
final ChatUserModel receiver;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Users(sender: $sender, receiver: $receiver)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$UsersImpl &&
|
||||
(identical(other.sender, sender) || other.sender == sender) &&
|
||||
(identical(other.receiver, receiver) ||
|
||||
other.receiver == receiver));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, sender, receiver);
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
|
||||
__$$UsersImplCopyWithImpl<_$UsersImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$UsersImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Users implements Users {
|
||||
const factory _Users(
|
||||
{@JsonKey(name: 'from_chat_user') required final ChatUserModel sender,
|
||||
@JsonKey(name: 'to_chat_user')
|
||||
required final ChatUserModel receiver}) = _$UsersImpl;
|
||||
|
||||
factory _Users.fromJson(Map<String, dynamic> json) = _$UsersImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'from_chat_user')
|
||||
ChatUserModel get sender;
|
||||
@override
|
||||
@JsonKey(name: 'to_chat_user')
|
||||
ChatUserModel get receiver;
|
||||
|
||||
/// Create a copy of Users
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_room_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatRoomModelImpl(
|
||||
id: json['id'] as String,
|
||||
chatRoomSettings: ChatRoomSettingsModel.fromJson(
|
||||
json['chat_room_setting'] as Map<String, dynamic>),
|
||||
users: Users.fromJson(json['users'] as Map<String, dynamic>),
|
||||
chosenPlan: parseChosenPlan(json['chosen_plan']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'chat_room_setting': instance.chatRoomSettings,
|
||||
'users': instance.users,
|
||||
'chosen_plan': instance.chosenPlan,
|
||||
};
|
||||
|
||||
_$UsersImpl _$$UsersImplFromJson(Map<String, dynamic> json) => _$UsersImpl(
|
||||
sender: ChatUserModel.fromJson(
|
||||
json['from_chat_user'] as Map<String, dynamic>),
|
||||
receiver:
|
||||
ChatUserModel.fromJson(json['to_chat_user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UsersImplToJson(_$UsersImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'from_chat_user': instance.sender,
|
||||
'to_chat_user': instance.receiver,
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,86 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_room_pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChatRoomPreviewModelImpl(
|
||||
chatRooms: ChatRooms.fromJson(json['chatRooms'] as Map<String, dynamic>),
|
||||
unreadChatsCount: (json['number_of_unread_chat_rooms'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatRoomPreviewModelImplToJson(
|
||||
_$ChatRoomPreviewModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'chatRooms': instance.chatRooms,
|
||||
'number_of_unread_chat_rooms': instance.unreadChatsCount,
|
||||
};
|
||||
|
||||
_$ChatRoomsImpl _$$ChatRoomsImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatRoomsImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) => ChatRoom.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
lastPage: (json['last_page'] as num).toInt(),
|
||||
currentPage: (json['current_page'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatRoomsImplToJson(_$ChatRoomsImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'last_page': instance.lastPage,
|
||||
'current_page': instance.currentPage,
|
||||
};
|
||||
|
||||
_$ChatRoomImpl _$$ChatRoomImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatRoomImpl(
|
||||
id: json['id'] as String,
|
||||
roomName: json['room_name'] as String,
|
||||
lastMessage: parseLastMessage(json['last_message']),
|
||||
users: Users.fromJson(json['users'] as Map<String, dynamic>),
|
||||
unreadMessagesCount: (json['unread_messages_count'] as num).toInt(),
|
||||
chosenPlan: parseChosenPlan(json['chosen_plan']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatRoomImplToJson(_$ChatRoomImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'room_name': instance.roomName,
|
||||
'last_message': instance.lastMessage,
|
||||
'users': instance.users,
|
||||
'unread_messages_count': instance.unreadMessagesCount,
|
||||
'chosen_plan': instance.chosenPlan,
|
||||
};
|
||||
|
||||
_$UsersImpl _$$UsersImplFromJson(Map<String, dynamic> json) => _$UsersImpl(
|
||||
fromChatUser:
|
||||
ChatUser.fromJson(json['from_chat_user'] as Map<String, dynamic>),
|
||||
toChatUser:
|
||||
ChatUser.fromJson(json['to_chat_user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UsersImplToJson(_$UsersImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'from_chat_user': instance.fromChatUser,
|
||||
'to_chat_user': instance.toChatUser,
|
||||
};
|
||||
|
||||
_$ChatUserImpl _$$ChatUserImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatUserImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
profilePhotoPath: json['profile_photo_path'] as String?,
|
||||
profilePhotoUrl: json['profile_photo_url'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatUserImplToJson(_$ChatUserImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'profile_photo_path': instance.profilePhotoPath,
|
||||
'profile_photo_url': instance.profilePhotoUrl,
|
||||
};
|
||||
@@ -1,267 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_room_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ChatRoomSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatRoomSettingsModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'room_name')
|
||||
String get roomName => throw _privateConstructorUsedError;
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'access_level')
|
||||
String get accessLevel => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at')
|
||||
String get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatRoomSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatRoomSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatRoomSettingsModelCopyWith<ChatRoomSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatRoomSettingsModelCopyWith<$Res> {
|
||||
factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value,
|
||||
$Res Function(ChatRoomSettingsModel) then) =
|
||||
_$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'room_name') String roomName,
|
||||
String state,
|
||||
@JsonKey(name: 'access_level') String accessLevel,
|
||||
@JsonKey(name: 'updated_at') String updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatRoomSettingsModelCopyWithImpl<$Res,
|
||||
$Val extends ChatRoomSettingsModel>
|
||||
implements $ChatRoomSettingsModelCopyWith<$Res> {
|
||||
_$ChatRoomSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatRoomSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? roomName = null,
|
||||
Object? state = null,
|
||||
Object? accessLevel = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
roomName: null == roomName
|
||||
? _value.roomName
|
||||
: roomName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
accessLevel: null == accessLevel
|
||||
? _value.accessLevel
|
||||
: accessLevel // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res>
|
||||
implements $ChatRoomSettingsModelCopyWith<$Res> {
|
||||
factory _$$ChatRoomSettingsModelImplCopyWith(
|
||||
_$ChatRoomSettingsModelImpl value,
|
||||
$Res Function(_$ChatRoomSettingsModelImpl) then) =
|
||||
__$$ChatRoomSettingsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'room_name') String roomName,
|
||||
String state,
|
||||
@JsonKey(name: 'access_level') String accessLevel,
|
||||
@JsonKey(name: 'updated_at') String updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomSettingsModelCopyWithImpl<$Res,
|
||||
_$ChatRoomSettingsModelImpl>
|
||||
implements _$$ChatRoomSettingsModelImplCopyWith<$Res> {
|
||||
__$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value,
|
||||
$Res Function(_$ChatRoomSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? roomName = null,
|
||||
Object? state = null,
|
||||
Object? accessLevel = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_$ChatRoomSettingsModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
roomName: null == roomName
|
||||
? _value.roomName
|
||||
: roomName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
accessLevel: null == accessLevel
|
||||
? _value.accessLevel
|
||||
: accessLevel // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel {
|
||||
const _$ChatRoomSettingsModelImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'room_name') required this.roomName,
|
||||
required this.state,
|
||||
@JsonKey(name: 'access_level') required this.accessLevel,
|
||||
@JsonKey(name: 'updated_at') required this.updatedAt});
|
||||
|
||||
factory _$ChatRoomSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatRoomSettingsModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: 'room_name')
|
||||
final String roomName;
|
||||
@override
|
||||
final String state;
|
||||
@override
|
||||
@JsonKey(name: 'access_level')
|
||||
final String accessLevel;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final String updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomSettingsModel(id: $id, roomName: $roomName, state: $state, accessLevel: $accessLevel, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatRoomSettingsModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.roomName, roomName) ||
|
||||
other.roomName == roomName) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.accessLevel, accessLevel) ||
|
||||
other.accessLevel == accessLevel) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt);
|
||||
|
||||
/// Create a copy of ChatRoomSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
|
||||
get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl<
|
||||
_$ChatRoomSettingsModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatRoomSettingsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel {
|
||||
const factory _ChatRoomSettingsModel(
|
||||
{required final int id,
|
||||
@JsonKey(name: 'room_name') required final String roomName,
|
||||
required final String state,
|
||||
@JsonKey(name: 'access_level') required final String accessLevel,
|
||||
@JsonKey(name: 'updated_at') required final String updatedAt}) =
|
||||
_$ChatRoomSettingsModelImpl;
|
||||
|
||||
factory _ChatRoomSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatRoomSettingsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: 'room_name')
|
||||
String get roomName;
|
||||
@override
|
||||
String get state;
|
||||
@override
|
||||
@JsonKey(name: 'access_level')
|
||||
String get accessLevel;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
String get updatedAt;
|
||||
|
||||
/// Create a copy of ChatRoomSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_room_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ChatRoomSettingsModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
roomName: json['room_name'] as String,
|
||||
state: json['state'] as String,
|
||||
accessLevel: json['access_level'] as String,
|
||||
updatedAt: json['updated_at'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatRoomSettingsModelImplToJson(
|
||||
_$ChatRoomSettingsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'room_name': instance.roomName,
|
||||
'state': instance.state,
|
||||
'access_level': instance.accessLevel,
|
||||
'updated_at': instance.updatedAt,
|
||||
};
|
||||
@@ -1,258 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_user_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ChatUserModel _$ChatUserModelFromJson(Map<String, dynamic> json) {
|
||||
return _ChatUserModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatUserModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'profile_photo_path')
|
||||
String? get profilePhotoPath => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String? get profilePhotoUrl => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChatUserModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatUserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatUserModelCopyWith<ChatUserModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatUserModelCopyWith<$Res> {
|
||||
factory $ChatUserModelCopyWith(
|
||||
ChatUserModel value, $Res Function(ChatUserModel) then) =
|
||||
_$ChatUserModelCopyWithImpl<$Res, ChatUserModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String slug,
|
||||
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
|
||||
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel>
|
||||
implements $ChatUserModelCopyWith<$Res> {
|
||||
_$ChatUserModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatUserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? slug = null,
|
||||
Object? profilePhotoPath = freezed,
|
||||
Object? profilePhotoUrl = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
profilePhotoPath: freezed == profilePhotoPath
|
||||
? _value.profilePhotoPath
|
||||
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
profilePhotoUrl: freezed == profilePhotoUrl
|
||||
? _value.profilePhotoUrl
|
||||
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatUserModelImplCopyWith<$Res>
|
||||
implements $ChatUserModelCopyWith<$Res> {
|
||||
factory _$$ChatUserModelImplCopyWith(
|
||||
_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) =
|
||||
__$$ChatUserModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String name,
|
||||
String slug,
|
||||
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
|
||||
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatUserModelImplCopyWithImpl<$Res>
|
||||
extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl>
|
||||
implements _$$ChatUserModelImplCopyWith<$Res> {
|
||||
__$$ChatUserModelImplCopyWithImpl(
|
||||
_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatUserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? slug = null,
|
||||
Object? profilePhotoPath = freezed,
|
||||
Object? profilePhotoUrl = freezed,
|
||||
}) {
|
||||
return _then(_$ChatUserModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
profilePhotoPath: freezed == profilePhotoPath
|
||||
? _value.profilePhotoPath
|
||||
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
profilePhotoUrl: freezed == profilePhotoUrl
|
||||
? _value.profilePhotoUrl
|
||||
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ChatUserModelImpl implements _ChatUserModel {
|
||||
const _$ChatUserModelImpl(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.slug,
|
||||
@JsonKey(name: 'profile_photo_path') this.profilePhotoPath,
|
||||
@JsonKey(name: 'profile_photo_url') this.profilePhotoUrl});
|
||||
|
||||
factory _$ChatUserModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChatUserModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String slug;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_path')
|
||||
final String? profilePhotoPath;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
final String? profilePhotoUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatUserModel(id: $id, name: $name, slug: $slug, profilePhotoPath: $profilePhotoPath, profilePhotoUrl: $profilePhotoUrl)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatUserModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.profilePhotoPath, profilePhotoPath) ||
|
||||
other.profilePhotoPath == profilePhotoPath) &&
|
||||
(identical(other.profilePhotoUrl, profilePhotoUrl) ||
|
||||
other.profilePhotoUrl == profilePhotoUrl));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, id, name, slug, profilePhotoPath, profilePhotoUrl);
|
||||
|
||||
/// Create a copy of ChatUserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith =>
|
||||
__$$ChatUserModelImplCopyWithImpl<_$ChatUserModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ChatUserModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatUserModel implements ChatUserModel {
|
||||
const factory _ChatUserModel(
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String slug,
|
||||
@JsonKey(name: 'profile_photo_path') final String? profilePhotoPath,
|
||||
@JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) =
|
||||
_$ChatUserModelImpl;
|
||||
|
||||
factory _ChatUserModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ChatUserModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get slug;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_path')
|
||||
String? get profilePhotoPath;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String? get profilePhotoUrl;
|
||||
|
||||
/// Create a copy of ChatUserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_user_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ChatUserModelImpl _$$ChatUserModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ChatUserModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
slug: json['slug'] as String,
|
||||
profilePhotoPath: json['profile_photo_path'] as String?,
|
||||
profilePhotoUrl: json['profile_photo_url'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ChatUserModelImplToJson(_$ChatUserModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'slug': instance.slug,
|
||||
'profile_photo_path': instance.profilePhotoPath,
|
||||
'profile_photo_url': instance.profilePhotoUrl,
|
||||
};
|
||||
@@ -1,170 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'payment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
PaymentModel _$PaymentModelFromJson(Map<String, dynamic> json) {
|
||||
return _PaymentModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PaymentModel {
|
||||
@JsonKey(name: 'checkout_url')
|
||||
String get paymentUrl => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this PaymentModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of PaymentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$PaymentModelCopyWith<PaymentModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $PaymentModelCopyWith<$Res> {
|
||||
factory $PaymentModelCopyWith(
|
||||
PaymentModel value, $Res Function(PaymentModel) then) =
|
||||
_$PaymentModelCopyWithImpl<$Res, PaymentModel>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'checkout_url') String paymentUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$PaymentModelCopyWithImpl<$Res, $Val extends PaymentModel>
|
||||
implements $PaymentModelCopyWith<$Res> {
|
||||
_$PaymentModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of PaymentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? paymentUrl = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
paymentUrl: null == paymentUrl
|
||||
? _value.paymentUrl
|
||||
: paymentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$PaymentModelImplCopyWith<$Res>
|
||||
implements $PaymentModelCopyWith<$Res> {
|
||||
factory _$$PaymentModelImplCopyWith(
|
||||
_$PaymentModelImpl value, $Res Function(_$PaymentModelImpl) then) =
|
||||
__$$PaymentModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'checkout_url') String paymentUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$PaymentModelImplCopyWithImpl<$Res>
|
||||
extends _$PaymentModelCopyWithImpl<$Res, _$PaymentModelImpl>
|
||||
implements _$$PaymentModelImplCopyWith<$Res> {
|
||||
__$$PaymentModelImplCopyWithImpl(
|
||||
_$PaymentModelImpl _value, $Res Function(_$PaymentModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of PaymentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? paymentUrl = null,
|
||||
}) {
|
||||
return _then(_$PaymentModelImpl(
|
||||
paymentUrl: null == paymentUrl
|
||||
? _value.paymentUrl
|
||||
: paymentUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$PaymentModelImpl implements _PaymentModel {
|
||||
_$PaymentModelImpl({@JsonKey(name: 'checkout_url') required this.paymentUrl});
|
||||
|
||||
factory _$PaymentModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PaymentModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'checkout_url')
|
||||
final String paymentUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PaymentModel(paymentUrl: $paymentUrl)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PaymentModelImpl &&
|
||||
(identical(other.paymentUrl, paymentUrl) ||
|
||||
other.paymentUrl == paymentUrl));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, paymentUrl);
|
||||
|
||||
/// Create a copy of PaymentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$PaymentModelImplCopyWith<_$PaymentModelImpl> get copyWith =>
|
||||
__$$PaymentModelImplCopyWithImpl<_$PaymentModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$PaymentModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _PaymentModel implements PaymentModel {
|
||||
factory _PaymentModel(
|
||||
{@JsonKey(name: 'checkout_url') required final String paymentUrl}) =
|
||||
_$PaymentModelImpl;
|
||||
|
||||
factory _PaymentModel.fromJson(Map<String, dynamic> json) =
|
||||
_$PaymentModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'checkout_url')
|
||||
String get paymentUrl;
|
||||
|
||||
/// Create a copy of PaymentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$PaymentModelImplCopyWith<_$PaymentModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'payment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$PaymentModelImpl _$$PaymentModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$PaymentModelImpl(
|
||||
paymentUrl: json['checkout_url'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PaymentModelImplToJson(_$PaymentModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'checkout_url': instance.paymentUrl,
|
||||
};
|
||||
@@ -1,254 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'websocket_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
WebsocketInfoModel _$WebsocketInfoModelFromJson(Map<String, dynamic> json) {
|
||||
return _WebsocketInfoModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$WebsocketInfoModel {
|
||||
String get key => throw _privateConstructorUsedError;
|
||||
String get host => throw _privateConstructorUsedError;
|
||||
String get port => throw _privateConstructorUsedError;
|
||||
String get cluster => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'user_id')
|
||||
int get userId => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this WebsocketInfoModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of WebsocketInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$WebsocketInfoModelCopyWith<WebsocketInfoModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $WebsocketInfoModelCopyWith<$Res> {
|
||||
factory $WebsocketInfoModelCopyWith(
|
||||
WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) =
|
||||
_$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String key,
|
||||
String host,
|
||||
String port,
|
||||
String cluster,
|
||||
@JsonKey(name: 'user_id') int userId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel>
|
||||
implements $WebsocketInfoModelCopyWith<$Res> {
|
||||
_$WebsocketInfoModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of WebsocketInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? key = null,
|
||||
Object? host = null,
|
||||
Object? port = null,
|
||||
Object? cluster = null,
|
||||
Object? userId = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
key: null == key
|
||||
? _value.key
|
||||
: key // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
host: null == host
|
||||
? _value.host
|
||||
: host // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
port: null == port
|
||||
? _value.port
|
||||
: port // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
cluster: null == cluster
|
||||
? _value.cluster
|
||||
: cluster // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$WebsocketInfoModelImplCopyWith<$Res>
|
||||
implements $WebsocketInfoModelCopyWith<$Res> {
|
||||
factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value,
|
||||
$Res Function(_$WebsocketInfoModelImpl) then) =
|
||||
__$$WebsocketInfoModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String key,
|
||||
String host,
|
||||
String port,
|
||||
String cluster,
|
||||
@JsonKey(name: 'user_id') int userId});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$WebsocketInfoModelImplCopyWithImpl<$Res>
|
||||
extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl>
|
||||
implements _$$WebsocketInfoModelImplCopyWith<$Res> {
|
||||
__$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value,
|
||||
$Res Function(_$WebsocketInfoModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of WebsocketInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? key = null,
|
||||
Object? host = null,
|
||||
Object? port = null,
|
||||
Object? cluster = null,
|
||||
Object? userId = null,
|
||||
}) {
|
||||
return _then(_$WebsocketInfoModelImpl(
|
||||
key: null == key
|
||||
? _value.key
|
||||
: key // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
host: null == host
|
||||
? _value.host
|
||||
: host // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
port: null == port
|
||||
? _value.port
|
||||
: port // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
cluster: null == cluster
|
||||
? _value.cluster
|
||||
: cluster // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$WebsocketInfoModelImpl implements _WebsocketInfoModel {
|
||||
const _$WebsocketInfoModelImpl(
|
||||
{required this.key,
|
||||
required this.host,
|
||||
required this.port,
|
||||
required this.cluster,
|
||||
@JsonKey(name: 'user_id') required this.userId});
|
||||
|
||||
factory _$WebsocketInfoModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$WebsocketInfoModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String key;
|
||||
@override
|
||||
final String host;
|
||||
@override
|
||||
final String port;
|
||||
@override
|
||||
final String cluster;
|
||||
@override
|
||||
@JsonKey(name: 'user_id')
|
||||
final int userId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'WebsocketInfoModel(key: $key, host: $host, port: $port, cluster: $cluster, userId: $userId)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$WebsocketInfoModelImpl &&
|
||||
(identical(other.key, key) || other.key == key) &&
|
||||
(identical(other.host, host) || other.host == host) &&
|
||||
(identical(other.port, port) || other.port == port) &&
|
||||
(identical(other.cluster, cluster) || other.cluster == cluster) &&
|
||||
(identical(other.userId, userId) || other.userId == userId));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, key, host, port, cluster, userId);
|
||||
|
||||
/// Create a copy of WebsocketInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith =>
|
||||
__$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$WebsocketInfoModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _WebsocketInfoModel implements WebsocketInfoModel {
|
||||
const factory _WebsocketInfoModel(
|
||||
{required final String key,
|
||||
required final String host,
|
||||
required final String port,
|
||||
required final String cluster,
|
||||
@JsonKey(name: 'user_id') required final int userId}) =
|
||||
_$WebsocketInfoModelImpl;
|
||||
|
||||
factory _WebsocketInfoModel.fromJson(Map<String, dynamic> json) =
|
||||
_$WebsocketInfoModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get key;
|
||||
@override
|
||||
String get host;
|
||||
@override
|
||||
String get port;
|
||||
@override
|
||||
String get cluster;
|
||||
@override
|
||||
@JsonKey(name: 'user_id')
|
||||
int get userId;
|
||||
|
||||
/// Create a copy of WebsocketInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'websocket_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$WebsocketInfoModelImpl(
|
||||
key: json['key'] as String,
|
||||
host: json['host'] as String,
|
||||
port: json['port'] as String,
|
||||
cluster: json['cluster'] as String,
|
||||
userId: (json['user_id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$WebsocketInfoModelImplToJson(
|
||||
_$WebsocketInfoModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'host': instance.host,
|
||||
'port': instance.port,
|
||||
'cluster': instance.cluster,
|
||||
'user_id': instance.userId,
|
||||
};
|
||||
@@ -1,803 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chat_room_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatRoomState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value) $default, {
|
||||
required TResult Function(ChatRoomStateLoading value) loading,
|
||||
required TResult Function(ChatRoomStateLoaded value) loaded,
|
||||
required TResult Function(ChatRoomStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ChatRoomState value)? $default, {
|
||||
TResult? Function(ChatRoomStateLoading value)? loading,
|
||||
TResult? Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult? Function(ChatRoomStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value)? $default, {
|
||||
TResult Function(ChatRoomStateLoading value)? loading,
|
||||
TResult Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult Function(ChatRoomStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatRoomStateCopyWith<$Res> {
|
||||
factory $ChatRoomStateCopyWith(
|
||||
ChatRoomState value, $Res Function(ChatRoomState) then) =
|
||||
_$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState>
|
||||
implements $ChatRoomStateCopyWith<$Res> {
|
||||
_$ChatRoomStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomStateImplCopyWith<$Res> {
|
||||
factory _$$ChatRoomStateImplCopyWith(
|
||||
_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) =
|
||||
__$$ChatRoomStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomStateImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl>
|
||||
implements _$$ChatRoomStateImplCopyWith<$Res> {
|
||||
__$$ChatRoomStateImplCopyWithImpl(
|
||||
_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ChatRoomStateImpl implements _ChatRoomState {
|
||||
const _$ChatRoomStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$ChatRoomStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value) $default, {
|
||||
required TResult Function(ChatRoomStateLoading value) loading,
|
||||
required TResult Function(ChatRoomStateLoaded value) loaded,
|
||||
required TResult Function(ChatRoomStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ChatRoomState value)? $default, {
|
||||
TResult? Function(ChatRoomStateLoading value)? loading,
|
||||
TResult? Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult? Function(ChatRoomStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value)? $default, {
|
||||
TResult Function(ChatRoomStateLoading value)? loading,
|
||||
TResult Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult Function(ChatRoomStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ChatRoomState implements ChatRoomState {
|
||||
const factory _ChatRoomState() = _$ChatRoomStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value,
|
||||
$Res Function(_$ChatRoomStateLoadingImpl) then) =
|
||||
__$$ChatRoomStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl>
|
||||
implements _$$ChatRoomStateLoadingImplCopyWith<$Res> {
|
||||
__$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value,
|
||||
$Res Function(_$ChatRoomStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading {
|
||||
const _$ChatRoomStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatRoomStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value) $default, {
|
||||
required TResult Function(ChatRoomStateLoading value) loading,
|
||||
required TResult Function(ChatRoomStateLoaded value) loaded,
|
||||
required TResult Function(ChatRoomStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ChatRoomState value)? $default, {
|
||||
TResult? Function(ChatRoomStateLoading value)? loading,
|
||||
TResult? Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult? Function(ChatRoomStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value)? $default, {
|
||||
TResult Function(ChatRoomStateLoading value)? loading,
|
||||
TResult Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult Function(ChatRoomStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ChatRoomStateLoading implements ChatRoomState {
|
||||
const factory ChatRoomStateLoading() = _$ChatRoomStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value,
|
||||
$Res Function(_$ChatRoomStateLoadedImpl) then) =
|
||||
__$$ChatRoomStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading});
|
||||
|
||||
$ChatRoomModelCopyWith<$Res> get chatRoom;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl>
|
||||
implements _$$ChatRoomStateLoadedImplCopyWith<$Res> {
|
||||
__$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value,
|
||||
$Res Function(_$ChatRoomStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? chatRoom = null,
|
||||
Object? chatMessages = null,
|
||||
Object? hasCard = null,
|
||||
Object? isTyping = null,
|
||||
Object? isLoading = null,
|
||||
}) {
|
||||
return _then(_$ChatRoomStateLoadedImpl(
|
||||
chatRoom: null == chatRoom
|
||||
? _value.chatRoom
|
||||
: chatRoom // ignore: cast_nullable_to_non_nullable
|
||||
as ChatRoomModel,
|
||||
chatMessages: null == chatMessages
|
||||
? _value._chatMessages
|
||||
: chatMessages // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChatMessageModel>,
|
||||
hasCard: null == hasCard
|
||||
? _value.hasCard
|
||||
: hasCard // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isTyping: null == isTyping
|
||||
? _value.isTyping
|
||||
: isTyping // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChatRoomModelCopyWith<$Res> get chatRoom {
|
||||
return $ChatRoomModelCopyWith<$Res>(_value.chatRoom, (value) {
|
||||
return _then(_value.copyWith(chatRoom: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
|
||||
const _$ChatRoomStateLoadedImpl(
|
||||
{required this.chatRoom,
|
||||
required final List<ChatMessageModel> chatMessages,
|
||||
required this.hasCard,
|
||||
required this.isTyping,
|
||||
required this.isLoading})
|
||||
: _chatMessages = chatMessages;
|
||||
|
||||
@override
|
||||
final ChatRoomModel chatRoom;
|
||||
final List<ChatMessageModel> _chatMessages;
|
||||
@override
|
||||
List<ChatMessageModel> get chatMessages {
|
||||
if (_chatMessages is EqualUnmodifiableListView) return _chatMessages;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_chatMessages);
|
||||
}
|
||||
|
||||
@override
|
||||
final bool hasCard;
|
||||
@override
|
||||
final bool isTyping;
|
||||
@override
|
||||
final bool isLoading;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomState.loaded(chatRoom: $chatRoom, chatMessages: $chatMessages, hasCard: $hasCard, isTyping: $isTyping, isLoading: $isLoading)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatRoomStateLoadedImpl &&
|
||||
(identical(other.chatRoom, chatRoom) ||
|
||||
other.chatRoom == chatRoom) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._chatMessages, _chatMessages) &&
|
||||
(identical(other.hasCard, hasCard) || other.hasCard == hasCard) &&
|
||||
(identical(other.isTyping, isTyping) ||
|
||||
other.isTyping == isTyping) &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
chatRoom,
|
||||
const DeepCollectionEquality().hash(_chatMessages),
|
||||
hasCard,
|
||||
isTyping,
|
||||
isLoading);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith =>
|
||||
__$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return loaded(chatRoom, chatMessages, hasCard, isTyping, isLoading);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return loaded?.call(chatRoom, chatMessages, hasCard, isTyping, isLoading);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(chatRoom, chatMessages, hasCard, isTyping, isLoading);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value) $default, {
|
||||
required TResult Function(ChatRoomStateLoading value) loading,
|
||||
required TResult Function(ChatRoomStateLoaded value) loaded,
|
||||
required TResult Function(ChatRoomStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ChatRoomState value)? $default, {
|
||||
TResult? Function(ChatRoomStateLoading value)? loading,
|
||||
TResult? Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult? Function(ChatRoomStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value)? $default, {
|
||||
TResult Function(ChatRoomStateLoading value)? loading,
|
||||
TResult Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult Function(ChatRoomStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ChatRoomStateLoaded implements ChatRoomState {
|
||||
const factory ChatRoomStateLoaded(
|
||||
{required final ChatRoomModel chatRoom,
|
||||
required final List<ChatMessageModel> chatMessages,
|
||||
required final bool hasCard,
|
||||
required final bool isTyping,
|
||||
required final bool isLoading}) = _$ChatRoomStateLoadedImpl;
|
||||
|
||||
ChatRoomModel get chatRoom;
|
||||
List<ChatMessageModel> get chatMessages;
|
||||
bool get hasCard;
|
||||
bool get isTyping;
|
||||
bool get isLoading;
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> {
|
||||
factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value,
|
||||
$Res Function(_$ChatRoomStateErrorImpl) then) =
|
||||
__$$ChatRoomStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatRoomStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl>
|
||||
implements _$$ChatRoomStateErrorImplCopyWith<$Res> {
|
||||
__$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value,
|
||||
$Res Function(_$ChatRoomStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$ChatRoomStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
|
||||
const _$ChatRoomStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatRoomState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatRoomStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith =>
|
||||
__$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)
|
||||
loaded,
|
||||
required TResult Function(String errorMessage) error,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(
|
||||
ChatRoomModel chatRoom,
|
||||
List<ChatMessageModel> chatMessages,
|
||||
bool hasCard,
|
||||
bool isTyping,
|
||||
bool isLoading)?
|
||||
loaded,
|
||||
TResult Function(String errorMessage)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value) $default, {
|
||||
required TResult Function(ChatRoomStateLoading value) loading,
|
||||
required TResult Function(ChatRoomStateLoaded value) loaded,
|
||||
required TResult Function(ChatRoomStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_ChatRoomState value)? $default, {
|
||||
TResult? Function(ChatRoomStateLoading value)? loading,
|
||||
TResult? Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult? Function(ChatRoomStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_ChatRoomState value)? $default, {
|
||||
TResult Function(ChatRoomStateLoading value)? loading,
|
||||
TResult Function(ChatRoomStateLoaded value)? loaded,
|
||||
TResult Function(ChatRoomStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ChatRoomStateError implements ChatRoomState {
|
||||
const factory ChatRoomStateError({required final String errorMessage}) =
|
||||
_$ChatRoomStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of ChatRoomState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'chats_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChatsState {
|
||||
BaseState get state => throw _privateConstructorUsedError;
|
||||
int get chatsWithUnreadMessagesCount => throw _privateConstructorUsedError;
|
||||
List<ChatRoom> get chatRooms => throw _privateConstructorUsedError;
|
||||
bool get isLoadingMoreChats => throw _privateConstructorUsedError;
|
||||
String? get errorMessage => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ChatsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ChatsStateCopyWith<ChatsState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ChatsStateCopyWith<$Res> {
|
||||
factory $ChatsStateCopyWith(
|
||||
ChatsState value, $Res Function(ChatsState) then) =
|
||||
_$ChatsStateCopyWithImpl<$Res, ChatsState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{BaseState state,
|
||||
int chatsWithUnreadMessagesCount,
|
||||
List<ChatRoom> chatRooms,
|
||||
bool isLoadingMoreChats,
|
||||
String? errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ChatsStateCopyWithImpl<$Res, $Val extends ChatsState>
|
||||
implements $ChatsStateCopyWith<$Res> {
|
||||
_$ChatsStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ChatsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? state = null,
|
||||
Object? chatsWithUnreadMessagesCount = null,
|
||||
Object? chatRooms = null,
|
||||
Object? isLoadingMoreChats = null,
|
||||
Object? errorMessage = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as BaseState,
|
||||
chatsWithUnreadMessagesCount: null == chatsWithUnreadMessagesCount
|
||||
? _value.chatsWithUnreadMessagesCount
|
||||
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chatRooms: null == chatRooms
|
||||
? _value.chatRooms
|
||||
: chatRooms // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChatRoom>,
|
||||
isLoadingMoreChats: null == isLoadingMoreChats
|
||||
? _value.isLoadingMoreChats
|
||||
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ChatsStateImplCopyWith<$Res>
|
||||
implements $ChatsStateCopyWith<$Res> {
|
||||
factory _$$ChatsStateImplCopyWith(
|
||||
_$ChatsStateImpl value, $Res Function(_$ChatsStateImpl) then) =
|
||||
__$$ChatsStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{BaseState state,
|
||||
int chatsWithUnreadMessagesCount,
|
||||
List<ChatRoom> chatRooms,
|
||||
bool isLoadingMoreChats,
|
||||
String? errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ChatsStateImplCopyWithImpl<$Res>
|
||||
extends _$ChatsStateCopyWithImpl<$Res, _$ChatsStateImpl>
|
||||
implements _$$ChatsStateImplCopyWith<$Res> {
|
||||
__$$ChatsStateImplCopyWithImpl(
|
||||
_$ChatsStateImpl _value, $Res Function(_$ChatsStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ChatsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? state = null,
|
||||
Object? chatsWithUnreadMessagesCount = null,
|
||||
Object? chatRooms = null,
|
||||
Object? isLoadingMoreChats = null,
|
||||
Object? errorMessage = freezed,
|
||||
}) {
|
||||
return _then(_$ChatsStateImpl(
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as BaseState,
|
||||
chatsWithUnreadMessagesCount: null == chatsWithUnreadMessagesCount
|
||||
? _value.chatsWithUnreadMessagesCount
|
||||
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
chatRooms: null == chatRooms
|
||||
? _value._chatRooms
|
||||
: chatRooms // ignore: cast_nullable_to_non_nullable
|
||||
as List<ChatRoom>,
|
||||
isLoadingMoreChats: null == isLoadingMoreChats
|
||||
? _value.isLoadingMoreChats
|
||||
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ChatsStateImpl implements _ChatsState {
|
||||
_$ChatsStateImpl(
|
||||
{this.state = BaseState.initial,
|
||||
this.chatsWithUnreadMessagesCount = 0,
|
||||
final List<ChatRoom> chatRooms = const [],
|
||||
this.isLoadingMoreChats = false,
|
||||
this.errorMessage = null})
|
||||
: _chatRooms = chatRooms;
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final BaseState state;
|
||||
@override
|
||||
@JsonKey()
|
||||
final int chatsWithUnreadMessagesCount;
|
||||
final List<ChatRoom> _chatRooms;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<ChatRoom> get chatRooms {
|
||||
if (_chatRooms is EqualUnmodifiableListView) return _chatRooms;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_chatRooms);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isLoadingMoreChats;
|
||||
@override
|
||||
@JsonKey()
|
||||
final String? errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatsState(state: $state, chatsWithUnreadMessagesCount: $chatsWithUnreadMessagesCount, chatRooms: $chatRooms, isLoadingMoreChats: $isLoadingMoreChats, errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ChatsStateImpl &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.chatsWithUnreadMessagesCount,
|
||||
chatsWithUnreadMessagesCount) ||
|
||||
other.chatsWithUnreadMessagesCount ==
|
||||
chatsWithUnreadMessagesCount) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._chatRooms, _chatRooms) &&
|
||||
(identical(other.isLoadingMoreChats, isLoadingMoreChats) ||
|
||||
other.isLoadingMoreChats == isLoadingMoreChats) &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
state,
|
||||
chatsWithUnreadMessagesCount,
|
||||
const DeepCollectionEquality().hash(_chatRooms),
|
||||
isLoadingMoreChats,
|
||||
errorMessage);
|
||||
|
||||
/// Create a copy of ChatsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ChatsStateImplCopyWith<_$ChatsStateImpl> get copyWith =>
|
||||
__$$ChatsStateImplCopyWithImpl<_$ChatsStateImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _ChatsState implements ChatsState {
|
||||
factory _ChatsState(
|
||||
{final BaseState state,
|
||||
final int chatsWithUnreadMessagesCount,
|
||||
final List<ChatRoom> chatRooms,
|
||||
final bool isLoadingMoreChats,
|
||||
final String? errorMessage}) = _$ChatsStateImpl;
|
||||
|
||||
@override
|
||||
BaseState get state;
|
||||
@override
|
||||
int get chatsWithUnreadMessagesCount;
|
||||
@override
|
||||
List<ChatRoom> get chatRooms;
|
||||
@override
|
||||
bool get isLoadingMoreChats;
|
||||
@override
|
||||
String? get errorMessage;
|
||||
|
||||
/// Create a copy of ChatsState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ChatsStateImplCopyWith<_$ChatsStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,291 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'chat_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _ChatService implements ChatService {
|
||||
_ChatService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<ChatRoomPaginationModel> getChatRooms({
|
||||
required int page,
|
||||
String? query,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{r'page': page, r'find': query};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ChatRoomPaginationModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ChatRoomPaginationModel _value;
|
||||
try {
|
||||
_value = ChatRoomPaginationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, ChatRoomModel>> getChatRoom({required String id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Map<String, ChatRoomModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/show/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Map<String, ChatRoomModel> _value;
|
||||
try {
|
||||
_value = _result.data!.map(
|
||||
(k, dynamic v) =>
|
||||
MapEntry(k, ChatRoomModel.fromJson(v as Map<String, dynamic>)),
|
||||
);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sendMessage({
|
||||
required String id,
|
||||
String? data,
|
||||
List<MultipartFile>? mediaData,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
if (data != null) {
|
||||
_data.fields.add(MapEntry('data', data));
|
||||
}
|
||||
if (mediaData != null) {
|
||||
_data.files.addAll(mediaData.map((i) => MapEntry('media_data[]', i)));
|
||||
}
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/${id}/message/send',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ChatMessagesModel> getChatMessages({
|
||||
required String id,
|
||||
required int page,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ChatMessagesModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/show/${id}/messages?page=${page}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ChatMessagesModel _value;
|
||||
try {
|
||||
_value = ChatMessagesModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ChatRoomModel> getChatRoomIdByUserSlug({required String user}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<ChatRoomModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/get_by_user/${user}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late ChatRoomModel _value;
|
||||
try {
|
||||
_value = ChatRoomModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> markMessagesAsRead({
|
||||
required String id,
|
||||
required Map<String, List<int>> body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(body);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chat/${id}/messages/markAsRead',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cancelChosenPlan({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chosen_plans/${id}/cancel',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> choseStartPlanDate({
|
||||
required int id,
|
||||
required Map<String, String> date,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(date);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chosen_plans/${id}/negotiate_contract_start',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaymentModel> getPaymentLink({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<PaymentModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/chosen_plans/${id}/start_payment_process',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late PaymentModel _value;
|
||||
try {
|
||||
_value = PaymentModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'complain_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ComplainModel _$ComplainModelFromJson(Map<String, dynamic> json) {
|
||||
return _ComplainModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ComplainModel {
|
||||
String? get description => throw _privateConstructorUsedError;
|
||||
List<String> get tags => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ComplainModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ComplainModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ComplainModelCopyWith<ComplainModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ComplainModelCopyWith<$Res> {
|
||||
factory $ComplainModelCopyWith(
|
||||
ComplainModel value, $Res Function(ComplainModel) then) =
|
||||
_$ComplainModelCopyWithImpl<$Res, ComplainModel>;
|
||||
@useResult
|
||||
$Res call({String? description, List<String> tags});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ComplainModelCopyWithImpl<$Res, $Val extends ComplainModel>
|
||||
implements $ComplainModelCopyWith<$Res> {
|
||||
_$ComplainModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ComplainModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? description = freezed,
|
||||
Object? tags = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
tags: null == tags
|
||||
? _value.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ComplainModelImplCopyWith<$Res>
|
||||
implements $ComplainModelCopyWith<$Res> {
|
||||
factory _$$ComplainModelImplCopyWith(
|
||||
_$ComplainModelImpl value, $Res Function(_$ComplainModelImpl) then) =
|
||||
__$$ComplainModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? description, List<String> tags});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ComplainModelImplCopyWithImpl<$Res>
|
||||
extends _$ComplainModelCopyWithImpl<$Res, _$ComplainModelImpl>
|
||||
implements _$$ComplainModelImplCopyWith<$Res> {
|
||||
__$$ComplainModelImplCopyWithImpl(
|
||||
_$ComplainModelImpl _value, $Res Function(_$ComplainModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ComplainModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? description = freezed,
|
||||
Object? tags = null,
|
||||
}) {
|
||||
return _then(_$ComplainModelImpl(
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
tags: null == tags
|
||||
? _value._tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ComplainModelImpl implements _ComplainModel {
|
||||
const _$ComplainModelImpl(
|
||||
{this.description = null, final List<String> tags = const []})
|
||||
: _tags = tags;
|
||||
|
||||
factory _$ComplainModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ComplainModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final String? description;
|
||||
final List<String> _tags;
|
||||
@override
|
||||
@JsonKey()
|
||||
List<String> get tags {
|
||||
if (_tags is EqualUnmodifiableListView) return _tags;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_tags);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ComplainModel(description: $description, tags: $tags)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ComplainModelImpl &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
const DeepCollectionEquality().equals(other._tags, _tags));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, description, const DeepCollectionEquality().hash(_tags));
|
||||
|
||||
/// Create a copy of ComplainModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ComplainModelImplCopyWith<_$ComplainModelImpl> get copyWith =>
|
||||
__$$ComplainModelImplCopyWithImpl<_$ComplainModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ComplainModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ComplainModel implements ComplainModel {
|
||||
const factory _ComplainModel(
|
||||
{final String? description,
|
||||
final List<String> tags}) = _$ComplainModelImpl;
|
||||
|
||||
factory _ComplainModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ComplainModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get description;
|
||||
@override
|
||||
List<String> get tags;
|
||||
|
||||
/// Create a copy of ComplainModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ComplainModelImplCopyWith<_$ComplainModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'complain_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ComplainModelImpl _$$ComplainModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ComplainModelImpl(
|
||||
description: json['description'] as String? ?? null,
|
||||
tags:
|
||||
(json['tags'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ComplainModelImplToJson(_$ComplainModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'description': instance.description,
|
||||
'tags': instance.tags,
|
||||
};
|
||||
@@ -1,298 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'complaining_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ComplainingState {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
bool? get wasSentSuccessfully => throw _privateConstructorUsedError;
|
||||
ComplainType? get category => throw _privateConstructorUsedError;
|
||||
ComplainedContent? get contentType => throw _privateConstructorUsedError;
|
||||
int? get contentId => throw _privateConstructorUsedError;
|
||||
String? get contentSlug => throw _privateConstructorUsedError;
|
||||
ComplainModel get complainInfo => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ComplainingStateCopyWith<ComplainingState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ComplainingStateCopyWith<$Res> {
|
||||
factory $ComplainingStateCopyWith(
|
||||
ComplainingState value, $Res Function(ComplainingState) then) =
|
||||
_$ComplainingStateCopyWithImpl<$Res, ComplainingState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
bool? wasSentSuccessfully,
|
||||
ComplainType? category,
|
||||
ComplainedContent? contentType,
|
||||
int? contentId,
|
||||
String? contentSlug,
|
||||
ComplainModel complainInfo});
|
||||
|
||||
$ComplainModelCopyWith<$Res> get complainInfo;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ComplainingStateCopyWithImpl<$Res, $Val extends ComplainingState>
|
||||
implements $ComplainingStateCopyWith<$Res> {
|
||||
_$ComplainingStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? wasSentSuccessfully = freezed,
|
||||
Object? category = freezed,
|
||||
Object? contentType = freezed,
|
||||
Object? contentId = freezed,
|
||||
Object? contentSlug = freezed,
|
||||
Object? complainInfo = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
wasSentSuccessfully: freezed == wasSentSuccessfully
|
||||
? _value.wasSentSuccessfully
|
||||
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
category: freezed == category
|
||||
? _value.category
|
||||
: category // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainType?,
|
||||
contentType: freezed == contentType
|
||||
? _value.contentType
|
||||
: contentType // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainedContent?,
|
||||
contentId: freezed == contentId
|
||||
? _value.contentId
|
||||
: contentId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
contentSlug: freezed == contentSlug
|
||||
? _value.contentSlug
|
||||
: contentSlug // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
complainInfo: null == complainInfo
|
||||
? _value.complainInfo
|
||||
: complainInfo // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainModel,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ComplainModelCopyWith<$Res> get complainInfo {
|
||||
return $ComplainModelCopyWith<$Res>(_value.complainInfo, (value) {
|
||||
return _then(_value.copyWith(complainInfo: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ComplainingStateImplCopyWith<$Res>
|
||||
implements $ComplainingStateCopyWith<$Res> {
|
||||
factory _$$ComplainingStateImplCopyWith(_$ComplainingStateImpl value,
|
||||
$Res Function(_$ComplainingStateImpl) then) =
|
||||
__$$ComplainingStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
bool? wasSentSuccessfully,
|
||||
ComplainType? category,
|
||||
ComplainedContent? contentType,
|
||||
int? contentId,
|
||||
String? contentSlug,
|
||||
ComplainModel complainInfo});
|
||||
|
||||
@override
|
||||
$ComplainModelCopyWith<$Res> get complainInfo;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ComplainingStateImplCopyWithImpl<$Res>
|
||||
extends _$ComplainingStateCopyWithImpl<$Res, _$ComplainingStateImpl>
|
||||
implements _$$ComplainingStateImplCopyWith<$Res> {
|
||||
__$$ComplainingStateImplCopyWithImpl(_$ComplainingStateImpl _value,
|
||||
$Res Function(_$ComplainingStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? wasSentSuccessfully = freezed,
|
||||
Object? category = freezed,
|
||||
Object? contentType = freezed,
|
||||
Object? contentId = freezed,
|
||||
Object? contentSlug = freezed,
|
||||
Object? complainInfo = null,
|
||||
}) {
|
||||
return _then(_$ComplainingStateImpl(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
wasSentSuccessfully: freezed == wasSentSuccessfully
|
||||
? _value.wasSentSuccessfully
|
||||
: wasSentSuccessfully // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
category: freezed == category
|
||||
? _value.category
|
||||
: category // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainType?,
|
||||
contentType: freezed == contentType
|
||||
? _value.contentType
|
||||
: contentType // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainedContent?,
|
||||
contentId: freezed == contentId
|
||||
? _value.contentId
|
||||
: contentId // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
contentSlug: freezed == contentSlug
|
||||
? _value.contentSlug
|
||||
: contentSlug // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
complainInfo: null == complainInfo
|
||||
? _value.complainInfo
|
||||
: complainInfo // ignore: cast_nullable_to_non_nullable
|
||||
as ComplainModel,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ComplainingStateImpl implements _ComplainingState {
|
||||
_$ComplainingStateImpl(
|
||||
{this.isLoading = false,
|
||||
this.wasSentSuccessfully = null,
|
||||
this.category = null,
|
||||
this.contentType = null,
|
||||
this.contentId = null,
|
||||
this.contentSlug = null,
|
||||
this.complainInfo = const ComplainModel()});
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isLoading;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool? wasSentSuccessfully;
|
||||
@override
|
||||
@JsonKey()
|
||||
final ComplainType? category;
|
||||
@override
|
||||
@JsonKey()
|
||||
final ComplainedContent? contentType;
|
||||
@override
|
||||
@JsonKey()
|
||||
final int? contentId;
|
||||
@override
|
||||
@JsonKey()
|
||||
final String? contentSlug;
|
||||
@override
|
||||
@JsonKey()
|
||||
final ComplainModel complainInfo;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ComplainingState(isLoading: $isLoading, wasSentSuccessfully: $wasSentSuccessfully, category: $category, contentType: $contentType, contentId: $contentId, contentSlug: $contentSlug, complainInfo: $complainInfo)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ComplainingStateImpl &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
(identical(other.wasSentSuccessfully, wasSentSuccessfully) ||
|
||||
other.wasSentSuccessfully == wasSentSuccessfully) &&
|
||||
(identical(other.category, category) ||
|
||||
other.category == category) &&
|
||||
(identical(other.contentType, contentType) ||
|
||||
other.contentType == contentType) &&
|
||||
(identical(other.contentId, contentId) ||
|
||||
other.contentId == contentId) &&
|
||||
(identical(other.contentSlug, contentSlug) ||
|
||||
other.contentSlug == contentSlug) &&
|
||||
(identical(other.complainInfo, complainInfo) ||
|
||||
other.complainInfo == complainInfo));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, isLoading, wasSentSuccessfully,
|
||||
category, contentType, contentId, contentSlug, complainInfo);
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ComplainingStateImplCopyWith<_$ComplainingStateImpl> get copyWith =>
|
||||
__$$ComplainingStateImplCopyWithImpl<_$ComplainingStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _ComplainingState implements ComplainingState {
|
||||
factory _ComplainingState(
|
||||
{final bool isLoading,
|
||||
final bool? wasSentSuccessfully,
|
||||
final ComplainType? category,
|
||||
final ComplainedContent? contentType,
|
||||
final int? contentId,
|
||||
final String? contentSlug,
|
||||
final ComplainModel complainInfo}) = _$ComplainingStateImpl;
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
bool? get wasSentSuccessfully;
|
||||
@override
|
||||
ComplainType? get category;
|
||||
@override
|
||||
ComplainedContent? get contentType;
|
||||
@override
|
||||
int? get contentId;
|
||||
@override
|
||||
String? get contentSlug;
|
||||
@override
|
||||
ComplainModel get complainInfo;
|
||||
|
||||
/// Create a copy of ComplainingState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ComplainingStateImplCopyWith<_$ComplainingStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'complaining_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _ComplainingService implements ComplainingService {
|
||||
_ComplainingService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> sendPlanComplain({
|
||||
required String slug,
|
||||
required String category,
|
||||
required ComplainModel body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = body;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/plans/${slug}/complain/${category}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sendRecipeComplain({
|
||||
required String slug,
|
||||
required String category,
|
||||
required ComplainModel body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = body;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/complain/${category}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sendBlogPostsComplain({
|
||||
required int id,
|
||||
required String category,
|
||||
required ComplainModel body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = body;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/${id}/complain/${category}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sendProfileComplain({
|
||||
required String slug,
|
||||
required String category,
|
||||
required ComplainModel body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = body;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/profile/${slug}/complain/${category}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sendDietComplain({
|
||||
required int id,
|
||||
required String category,
|
||||
required ComplainModel body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = body;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/complain/${category}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,730 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'consultant_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ConsultantProfileModel _$ConsultantProfileModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ConsultantProfileModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConsultantProfileModel {
|
||||
@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
bool? get hasMedicalEducation => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
SocialLinksModel? get socialLinks => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false)
|
||||
List<String>? get photos => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
List<CertificatesModel>? get certificates =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ConsultantProfileModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ConsultantProfileModelCopyWith<ConsultantProfileModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ConsultantProfileModelCopyWith<$Res> {
|
||||
factory $ConsultantProfileModelCopyWith(ConsultantProfileModel value,
|
||||
$Res Function(ConsultantProfileModel) then) =
|
||||
_$ConsultantProfileModelCopyWithImpl<$Res, ConsultantProfileModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
bool? hasMedicalEducation,
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
SocialLinksModel? socialLinks,
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false) List<String>? photos,
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
List<CertificatesModel>? certificates});
|
||||
|
||||
$SocialLinksModelCopyWith<$Res>? get socialLinks;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ConsultantProfileModelCopyWithImpl<$Res,
|
||||
$Val extends ConsultantProfileModel>
|
||||
implements $ConsultantProfileModelCopyWith<$Res> {
|
||||
_$ConsultantProfileModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? hasMedicalEducation = freezed,
|
||||
Object? socialLinks = freezed,
|
||||
Object? photos = freezed,
|
||||
Object? certificates = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
hasMedicalEducation: freezed == hasMedicalEducation
|
||||
? _value.hasMedicalEducation
|
||||
: hasMedicalEducation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
socialLinks: freezed == socialLinks
|
||||
? _value.socialLinks
|
||||
: socialLinks // ignore: cast_nullable_to_non_nullable
|
||||
as SocialLinksModel?,
|
||||
photos: freezed == photos
|
||||
? _value.photos
|
||||
: photos // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
certificates: freezed == certificates
|
||||
? _value.certificates
|
||||
: certificates // ignore: cast_nullable_to_non_nullable
|
||||
as List<CertificatesModel>?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$SocialLinksModelCopyWith<$Res>? get socialLinks {
|
||||
if (_value.socialLinks == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $SocialLinksModelCopyWith<$Res>(_value.socialLinks!, (value) {
|
||||
return _then(_value.copyWith(socialLinks: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ConsultantProfileModelImplCopyWith<$Res>
|
||||
implements $ConsultantProfileModelCopyWith<$Res> {
|
||||
factory _$$ConsultantProfileModelImplCopyWith(
|
||||
_$ConsultantProfileModelImpl value,
|
||||
$Res Function(_$ConsultantProfileModelImpl) then) =
|
||||
__$$ConsultantProfileModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
bool? hasMedicalEducation,
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
SocialLinksModel? socialLinks,
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false) List<String>? photos,
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
List<CertificatesModel>? certificates});
|
||||
|
||||
@override
|
||||
$SocialLinksModelCopyWith<$Res>? get socialLinks;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ConsultantProfileModelImplCopyWithImpl<$Res>
|
||||
extends _$ConsultantProfileModelCopyWithImpl<$Res,
|
||||
_$ConsultantProfileModelImpl>
|
||||
implements _$$ConsultantProfileModelImplCopyWith<$Res> {
|
||||
__$$ConsultantProfileModelImplCopyWithImpl(
|
||||
_$ConsultantProfileModelImpl _value,
|
||||
$Res Function(_$ConsultantProfileModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? hasMedicalEducation = freezed,
|
||||
Object? socialLinks = freezed,
|
||||
Object? photos = freezed,
|
||||
Object? certificates = freezed,
|
||||
}) {
|
||||
return _then(_$ConsultantProfileModelImpl(
|
||||
hasMedicalEducation: freezed == hasMedicalEducation
|
||||
? _value.hasMedicalEducation
|
||||
: hasMedicalEducation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,
|
||||
socialLinks: freezed == socialLinks
|
||||
? _value.socialLinks
|
||||
: socialLinks // ignore: cast_nullable_to_non_nullable
|
||||
as SocialLinksModel?,
|
||||
photos: freezed == photos
|
||||
? _value._photos
|
||||
: photos // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
certificates: freezed == certificates
|
||||
? _value._certificates
|
||||
: certificates // ignore: cast_nullable_to_non_nullable
|
||||
as List<CertificatesModel>?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ConsultantProfileModelImpl implements _ConsultantProfileModel {
|
||||
const _$ConsultantProfileModelImpl(
|
||||
{@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
this.hasMedicalEducation,
|
||||
@JsonKey(name: 'social_links', includeIfNull: false) this.socialLinks,
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false)
|
||||
final List<String>? photos,
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
final List<CertificatesModel>? certificates})
|
||||
: _photos = photos,
|
||||
_certificates = certificates;
|
||||
|
||||
factory _$ConsultantProfileModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ConsultantProfileModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
final bool? hasMedicalEducation;
|
||||
@override
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
final SocialLinksModel? socialLinks;
|
||||
final List<String>? _photos;
|
||||
@override
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false)
|
||||
List<String>? get photos {
|
||||
final value = _photos;
|
||||
if (value == null) return null;
|
||||
if (_photos is EqualUnmodifiableListView) return _photos;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
final List<CertificatesModel>? _certificates;
|
||||
@override
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
List<CertificatesModel>? get certificates {
|
||||
final value = _certificates;
|
||||
if (value == null) return null;
|
||||
if (_certificates is EqualUnmodifiableListView) return _certificates;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConsultantProfileModel(hasMedicalEducation: $hasMedicalEducation, socialLinks: $socialLinks, photos: $photos, certificates: $certificates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ConsultantProfileModelImpl &&
|
||||
(identical(other.hasMedicalEducation, hasMedicalEducation) ||
|
||||
other.hasMedicalEducation == hasMedicalEducation) &&
|
||||
(identical(other.socialLinks, socialLinks) ||
|
||||
other.socialLinks == socialLinks) &&
|
||||
const DeepCollectionEquality().equals(other._photos, _photos) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._certificates, _certificates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
hasMedicalEducation,
|
||||
socialLinks,
|
||||
const DeepCollectionEquality().hash(_photos),
|
||||
const DeepCollectionEquality().hash(_certificates));
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ConsultantProfileModelImplCopyWith<_$ConsultantProfileModelImpl>
|
||||
get copyWith => __$$ConsultantProfileModelImplCopyWithImpl<
|
||||
_$ConsultantProfileModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ConsultantProfileModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ConsultantProfileModel implements ConsultantProfileModel {
|
||||
const factory _ConsultantProfileModel(
|
||||
{@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
final bool? hasMedicalEducation,
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
final SocialLinksModel? socialLinks,
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false)
|
||||
final List<String>? photos,
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
final List<CertificatesModel>? certificates}) =
|
||||
_$ConsultantProfileModelImpl;
|
||||
|
||||
factory _ConsultantProfileModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ConsultantProfileModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'has_medical_education', includeIfNull: false)
|
||||
bool? get hasMedicalEducation;
|
||||
@override
|
||||
@JsonKey(name: 'social_links', includeIfNull: false)
|
||||
SocialLinksModel? get socialLinks;
|
||||
@override
|
||||
@JsonKey(name: 'cert_photos', includeIfNull: false)
|
||||
List<String>? get photos;
|
||||
@override
|
||||
@JsonKey(name: 'completed_courses', includeIfNull: false)
|
||||
List<CertificatesModel>? get certificates;
|
||||
|
||||
/// Create a copy of ConsultantProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ConsultantProfileModelImplCopyWith<_$ConsultantProfileModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
SocialLinksModel _$SocialLinksModelFromJson(Map<String, dynamic> json) {
|
||||
return _SocialLinksModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SocialLinksModel {
|
||||
@JsonKey(name: 'vk_link', includeIfNull: false)
|
||||
String? get vkLink => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false)
|
||||
String? get tgLink => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false)
|
||||
String? get fbLink => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false)
|
||||
String? get instaLink => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
String? get personalSiteLink => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this SocialLinksModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of SocialLinksModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$SocialLinksModelCopyWith<SocialLinksModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SocialLinksModelCopyWith<$Res> {
|
||||
factory $SocialLinksModelCopyWith(
|
||||
SocialLinksModel value, $Res Function(SocialLinksModel) then) =
|
||||
_$SocialLinksModelCopyWithImpl<$Res, SocialLinksModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'vk_link', includeIfNull: false) String? vkLink,
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false) String? tgLink,
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false) String? fbLink,
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false) String? instaLink,
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
String? personalSiteLink});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SocialLinksModelCopyWithImpl<$Res, $Val extends SocialLinksModel>
|
||||
implements $SocialLinksModelCopyWith<$Res> {
|
||||
_$SocialLinksModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SocialLinksModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vkLink = freezed,
|
||||
Object? tgLink = freezed,
|
||||
Object? fbLink = freezed,
|
||||
Object? instaLink = freezed,
|
||||
Object? personalSiteLink = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
vkLink: freezed == vkLink
|
||||
? _value.vkLink
|
||||
: vkLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
tgLink: freezed == tgLink
|
||||
? _value.tgLink
|
||||
: tgLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fbLink: freezed == fbLink
|
||||
? _value.fbLink
|
||||
: fbLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
instaLink: freezed == instaLink
|
||||
? _value.instaLink
|
||||
: instaLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
personalSiteLink: freezed == personalSiteLink
|
||||
? _value.personalSiteLink
|
||||
: personalSiteLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SocialLinksModelImplCopyWith<$Res>
|
||||
implements $SocialLinksModelCopyWith<$Res> {
|
||||
factory _$$SocialLinksModelImplCopyWith(_$SocialLinksModelImpl value,
|
||||
$Res Function(_$SocialLinksModelImpl) then) =
|
||||
__$$SocialLinksModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'vk_link', includeIfNull: false) String? vkLink,
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false) String? tgLink,
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false) String? fbLink,
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false) String? instaLink,
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
String? personalSiteLink});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SocialLinksModelImplCopyWithImpl<$Res>
|
||||
extends _$SocialLinksModelCopyWithImpl<$Res, _$SocialLinksModelImpl>
|
||||
implements _$$SocialLinksModelImplCopyWith<$Res> {
|
||||
__$$SocialLinksModelImplCopyWithImpl(_$SocialLinksModelImpl _value,
|
||||
$Res Function(_$SocialLinksModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SocialLinksModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? vkLink = freezed,
|
||||
Object? tgLink = freezed,
|
||||
Object? fbLink = freezed,
|
||||
Object? instaLink = freezed,
|
||||
Object? personalSiteLink = freezed,
|
||||
}) {
|
||||
return _then(_$SocialLinksModelImpl(
|
||||
vkLink: freezed == vkLink
|
||||
? _value.vkLink
|
||||
: vkLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
tgLink: freezed == tgLink
|
||||
? _value.tgLink
|
||||
: tgLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fbLink: freezed == fbLink
|
||||
? _value.fbLink
|
||||
: fbLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
instaLink: freezed == instaLink
|
||||
? _value.instaLink
|
||||
: instaLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
personalSiteLink: freezed == personalSiteLink
|
||||
? _value.personalSiteLink
|
||||
: personalSiteLink // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$SocialLinksModelImpl implements _SocialLinksModel {
|
||||
const _$SocialLinksModelImpl(
|
||||
{@JsonKey(name: 'vk_link', includeIfNull: false) this.vkLink,
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false) this.tgLink,
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false) this.fbLink,
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false) this.instaLink,
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
this.personalSiteLink});
|
||||
|
||||
factory _$SocialLinksModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$SocialLinksModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vk_link', includeIfNull: false)
|
||||
final String? vkLink;
|
||||
@override
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false)
|
||||
final String? tgLink;
|
||||
@override
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false)
|
||||
final String? fbLink;
|
||||
@override
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false)
|
||||
final String? instaLink;
|
||||
@override
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
final String? personalSiteLink;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SocialLinksModel(vkLink: $vkLink, tgLink: $tgLink, fbLink: $fbLink, instaLink: $instaLink, personalSiteLink: $personalSiteLink)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$SocialLinksModelImpl &&
|
||||
(identical(other.vkLink, vkLink) || other.vkLink == vkLink) &&
|
||||
(identical(other.tgLink, tgLink) || other.tgLink == tgLink) &&
|
||||
(identical(other.fbLink, fbLink) || other.fbLink == fbLink) &&
|
||||
(identical(other.instaLink, instaLink) ||
|
||||
other.instaLink == instaLink) &&
|
||||
(identical(other.personalSiteLink, personalSiteLink) ||
|
||||
other.personalSiteLink == personalSiteLink));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, vkLink, tgLink, fbLink, instaLink, personalSiteLink);
|
||||
|
||||
/// Create a copy of SocialLinksModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SocialLinksModelImplCopyWith<_$SocialLinksModelImpl> get copyWith =>
|
||||
__$$SocialLinksModelImplCopyWithImpl<_$SocialLinksModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$SocialLinksModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SocialLinksModel implements SocialLinksModel {
|
||||
const factory _SocialLinksModel(
|
||||
{@JsonKey(name: 'vk_link', includeIfNull: false) final String? vkLink,
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false) final String? tgLink,
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false) final String? fbLink,
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false)
|
||||
final String? instaLink,
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
final String? personalSiteLink}) = _$SocialLinksModelImpl;
|
||||
|
||||
factory _SocialLinksModel.fromJson(Map<String, dynamic> json) =
|
||||
_$SocialLinksModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vk_link', includeIfNull: false)
|
||||
String? get vkLink;
|
||||
@override
|
||||
@JsonKey(name: 'tg_link', includeIfNull: false)
|
||||
String? get tgLink;
|
||||
@override
|
||||
@JsonKey(name: 'fb_link', includeIfNull: false)
|
||||
String? get fbLink;
|
||||
@override
|
||||
@JsonKey(name: 'insta_link', includeIfNull: false)
|
||||
String? get instaLink;
|
||||
@override
|
||||
@JsonKey(name: 'personal_site_link', includeIfNull: false)
|
||||
String? get personalSiteLink;
|
||||
|
||||
/// Create a copy of SocialLinksModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SocialLinksModelImplCopyWith<_$SocialLinksModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
CertificatesModel _$CertificatesModelFromJson(Map<String, dynamic> json) {
|
||||
return _CertificatesModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CertificatesModel {
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
String get date => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CertificatesModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CertificatesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CertificatesModelCopyWith<CertificatesModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CertificatesModelCopyWith<$Res> {
|
||||
factory $CertificatesModelCopyWith(
|
||||
CertificatesModel value, $Res Function(CertificatesModel) then) =
|
||||
_$CertificatesModelCopyWithImpl<$Res, CertificatesModel>;
|
||||
@useResult
|
||||
$Res call({String title, String date});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CertificatesModelCopyWithImpl<$Res, $Val extends CertificatesModel>
|
||||
implements $CertificatesModelCopyWith<$Res> {
|
||||
_$CertificatesModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CertificatesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = null,
|
||||
Object? date = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CertificatesModelImplCopyWith<$Res>
|
||||
implements $CertificatesModelCopyWith<$Res> {
|
||||
factory _$$CertificatesModelImplCopyWith(_$CertificatesModelImpl value,
|
||||
$Res Function(_$CertificatesModelImpl) then) =
|
||||
__$$CertificatesModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String title, String date});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CertificatesModelImplCopyWithImpl<$Res>
|
||||
extends _$CertificatesModelCopyWithImpl<$Res, _$CertificatesModelImpl>
|
||||
implements _$$CertificatesModelImplCopyWith<$Res> {
|
||||
__$$CertificatesModelImplCopyWithImpl(_$CertificatesModelImpl _value,
|
||||
$Res Function(_$CertificatesModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CertificatesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = null,
|
||||
Object? date = null,
|
||||
}) {
|
||||
return _then(_$CertificatesModelImpl(
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CertificatesModelImpl implements _CertificatesModel {
|
||||
const _$CertificatesModelImpl({required this.title, required this.date});
|
||||
|
||||
factory _$CertificatesModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CertificatesModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
final String date;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CertificatesModel(title: $title, date: $date)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CertificatesModelImpl &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.date, date) || other.date == date));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, title, date);
|
||||
|
||||
/// Create a copy of CertificatesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CertificatesModelImplCopyWith<_$CertificatesModelImpl> get copyWith =>
|
||||
__$$CertificatesModelImplCopyWithImpl<_$CertificatesModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CertificatesModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CertificatesModel implements CertificatesModel {
|
||||
const factory _CertificatesModel(
|
||||
{required final String title,
|
||||
required final String date}) = _$CertificatesModelImpl;
|
||||
|
||||
factory _CertificatesModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CertificatesModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
String get date;
|
||||
|
||||
/// Create a copy of CertificatesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CertificatesModelImplCopyWith<_$CertificatesModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'consultant_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ConsultantProfileModelImpl _$$ConsultantProfileModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ConsultantProfileModelImpl(
|
||||
hasMedicalEducation: json['has_medical_education'] as bool?,
|
||||
socialLinks: json['social_links'] == null
|
||||
? null
|
||||
: SocialLinksModel.fromJson(
|
||||
json['social_links'] as Map<String, dynamic>),
|
||||
photos: (json['cert_photos'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
certificates: (json['completed_courses'] as List<dynamic>?)
|
||||
?.map((e) => CertificatesModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ConsultantProfileModelImplToJson(
|
||||
_$ConsultantProfileModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.hasMedicalEducation case final value?)
|
||||
'has_medical_education': value,
|
||||
if (instance.socialLinks case final value?) 'social_links': value,
|
||||
if (instance.photos case final value?) 'cert_photos': value,
|
||||
if (instance.certificates case final value?) 'completed_courses': value,
|
||||
};
|
||||
|
||||
_$SocialLinksModelImpl _$$SocialLinksModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$SocialLinksModelImpl(
|
||||
vkLink: json['vk_link'] as String?,
|
||||
tgLink: json['tg_link'] as String?,
|
||||
fbLink: json['fb_link'] as String?,
|
||||
instaLink: json['insta_link'] as String?,
|
||||
personalSiteLink: json['personal_site_link'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$SocialLinksModelImplToJson(
|
||||
_$SocialLinksModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.vkLink case final value?) 'vk_link': value,
|
||||
if (instance.tgLink case final value?) 'tg_link': value,
|
||||
if (instance.fbLink case final value?) 'fb_link': value,
|
||||
if (instance.instaLink case final value?) 'insta_link': value,
|
||||
if (instance.personalSiteLink case final value?)
|
||||
'personal_site_link': value,
|
||||
};
|
||||
|
||||
_$CertificatesModelImpl _$$CertificatesModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$CertificatesModelImpl(
|
||||
title: json['title'] as String,
|
||||
date: json['date'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CertificatesModelImplToJson(
|
||||
_$CertificatesModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'title': instance.title,
|
||||
'date': instance.date,
|
||||
};
|
||||
@@ -1,184 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'register_consultant_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RegisterConsultantState {
|
||||
ConsultantProfileModel get consultant => throw _privateConstructorUsedError;
|
||||
bool get acceptOffer => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RegisterConsultantStateCopyWith<RegisterConsultantState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RegisterConsultantStateCopyWith<$Res> {
|
||||
factory $RegisterConsultantStateCopyWith(RegisterConsultantState value,
|
||||
$Res Function(RegisterConsultantState) then) =
|
||||
_$RegisterConsultantStateCopyWithImpl<$Res, RegisterConsultantState>;
|
||||
@useResult
|
||||
$Res call({ConsultantProfileModel consultant, bool acceptOffer});
|
||||
|
||||
$ConsultantProfileModelCopyWith<$Res> get consultant;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RegisterConsultantStateCopyWithImpl<$Res,
|
||||
$Val extends RegisterConsultantState>
|
||||
implements $RegisterConsultantStateCopyWith<$Res> {
|
||||
_$RegisterConsultantStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? consultant = null,
|
||||
Object? acceptOffer = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
consultant: null == consultant
|
||||
? _value.consultant
|
||||
: consultant // ignore: cast_nullable_to_non_nullable
|
||||
as ConsultantProfileModel,
|
||||
acceptOffer: null == acceptOffer
|
||||
? _value.acceptOffer
|
||||
: acceptOffer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$ConsultantProfileModelCopyWith<$Res> get consultant {
|
||||
return $ConsultantProfileModelCopyWith<$Res>(_value.consultant, (value) {
|
||||
return _then(_value.copyWith(consultant: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RegisterConsultantStateImplCopyWith<$Res>
|
||||
implements $RegisterConsultantStateCopyWith<$Res> {
|
||||
factory _$$RegisterConsultantStateImplCopyWith(
|
||||
_$RegisterConsultantStateImpl value,
|
||||
$Res Function(_$RegisterConsultantStateImpl) then) =
|
||||
__$$RegisterConsultantStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({ConsultantProfileModel consultant, bool acceptOffer});
|
||||
|
||||
@override
|
||||
$ConsultantProfileModelCopyWith<$Res> get consultant;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RegisterConsultantStateImplCopyWithImpl<$Res>
|
||||
extends _$RegisterConsultantStateCopyWithImpl<$Res,
|
||||
_$RegisterConsultantStateImpl>
|
||||
implements _$$RegisterConsultantStateImplCopyWith<$Res> {
|
||||
__$$RegisterConsultantStateImplCopyWithImpl(
|
||||
_$RegisterConsultantStateImpl _value,
|
||||
$Res Function(_$RegisterConsultantStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? consultant = null,
|
||||
Object? acceptOffer = null,
|
||||
}) {
|
||||
return _then(_$RegisterConsultantStateImpl(
|
||||
consultant: null == consultant
|
||||
? _value.consultant
|
||||
: consultant // ignore: cast_nullable_to_non_nullable
|
||||
as ConsultantProfileModel,
|
||||
acceptOffer: null == acceptOffer
|
||||
? _value.acceptOffer
|
||||
: acceptOffer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$RegisterConsultantStateImpl implements _RegisterConsultantState {
|
||||
const _$RegisterConsultantStateImpl(
|
||||
{required this.consultant, required this.acceptOffer});
|
||||
|
||||
@override
|
||||
final ConsultantProfileModel consultant;
|
||||
@override
|
||||
final bool acceptOffer;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RegisterConsultantState(consultant: $consultant, acceptOffer: $acceptOffer)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RegisterConsultantStateImpl &&
|
||||
(identical(other.consultant, consultant) ||
|
||||
other.consultant == consultant) &&
|
||||
(identical(other.acceptOffer, acceptOffer) ||
|
||||
other.acceptOffer == acceptOffer));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, consultant, acceptOffer);
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RegisterConsultantStateImplCopyWith<_$RegisterConsultantStateImpl>
|
||||
get copyWith => __$$RegisterConsultantStateImplCopyWithImpl<
|
||||
_$RegisterConsultantStateImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _RegisterConsultantState implements RegisterConsultantState {
|
||||
const factory _RegisterConsultantState(
|
||||
{required final ConsultantProfileModel consultant,
|
||||
required final bool acceptOffer}) = _$RegisterConsultantStateImpl;
|
||||
|
||||
@override
|
||||
ConsultantProfileModel get consultant;
|
||||
@override
|
||||
bool get acceptOffer;
|
||||
|
||||
/// Create a copy of RegisterConsultantState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RegisterConsultantStateImplCopyWith<_$RegisterConsultantStateImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'consultant_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _ConsultantService implements ConsultantService {
|
||||
_ConsultantService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> consultantRegistration({
|
||||
required ConsultantProfileModel consultantModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = consultantModel;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/consultant_request/registration',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> uploadPhotos({List<MultipartFile>? photos}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
if (photos != null) {
|
||||
_data.files.addAll(photos.map((i) => MapEntry('photos[]', i)));
|
||||
}
|
||||
final _options = _setStreamType<List<String>>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/consultant_request/photos/upload',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<String> _value;
|
||||
try {
|
||||
_value = _result.data!.cast<String>();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'rating_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
RatingModel _$RatingModelFromJson(Map<String, dynamic> json) {
|
||||
return _RatingModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RatingModel {
|
||||
DateTime get date => throw _privateConstructorUsedError;
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
int get amount => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RatingModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RatingModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RatingModelCopyWith<RatingModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RatingModelCopyWith<$Res> {
|
||||
factory $RatingModelCopyWith(
|
||||
RatingModel value, $Res Function(RatingModel) then) =
|
||||
_$RatingModelCopyWithImpl<$Res, RatingModel>;
|
||||
@useResult
|
||||
$Res call({DateTime date, String title, int amount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RatingModelCopyWithImpl<$Res, $Val extends RatingModel>
|
||||
implements $RatingModelCopyWith<$Res> {
|
||||
_$RatingModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RatingModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? title = null,
|
||||
Object? amount = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
amount: null == amount
|
||||
? _value.amount
|
||||
: amount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RatingModelImplCopyWith<$Res>
|
||||
implements $RatingModelCopyWith<$Res> {
|
||||
factory _$$RatingModelImplCopyWith(
|
||||
_$RatingModelImpl value, $Res Function(_$RatingModelImpl) then) =
|
||||
__$$RatingModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({DateTime date, String title, int amount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RatingModelImplCopyWithImpl<$Res>
|
||||
extends _$RatingModelCopyWithImpl<$Res, _$RatingModelImpl>
|
||||
implements _$$RatingModelImplCopyWith<$Res> {
|
||||
__$$RatingModelImplCopyWithImpl(
|
||||
_$RatingModelImpl _value, $Res Function(_$RatingModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RatingModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? date = null,
|
||||
Object? title = null,
|
||||
Object? amount = null,
|
||||
}) {
|
||||
return _then(_$RatingModelImpl(
|
||||
date: null == date
|
||||
? _value.date
|
||||
: date // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
amount: null == amount
|
||||
? _value.amount
|
||||
: amount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$RatingModelImpl implements _RatingModel {
|
||||
_$RatingModelImpl(
|
||||
{required this.date, required this.title, required this.amount});
|
||||
|
||||
factory _$RatingModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RatingModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final DateTime date;
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
final int amount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RatingModel(date: $date, title: $title, amount: $amount)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RatingModelImpl &&
|
||||
(identical(other.date, date) || other.date == date) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.amount, amount) || other.amount == amount));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, date, title, amount);
|
||||
|
||||
/// Create a copy of RatingModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RatingModelImplCopyWith<_$RatingModelImpl> get copyWith =>
|
||||
__$$RatingModelImplCopyWithImpl<_$RatingModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$RatingModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _RatingModel implements RatingModel {
|
||||
factory _RatingModel(
|
||||
{required final DateTime date,
|
||||
required final String title,
|
||||
required final int amount}) = _$RatingModelImpl;
|
||||
|
||||
factory _RatingModel.fromJson(Map<String, dynamic> json) =
|
||||
_$RatingModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
DateTime get date;
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
int get amount;
|
||||
|
||||
/// Create a copy of RatingModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RatingModelImplCopyWith<_$RatingModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rating_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RatingModelImpl _$$RatingModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RatingModelImpl(
|
||||
date: DateTime.parse(json['date'] as String),
|
||||
title: json['title'] as String,
|
||||
amount: (json['amount'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RatingModelImplToJson(_$RatingModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date.toIso8601String(),
|
||||
'title': instance.title,
|
||||
'amount': instance.amount,
|
||||
};
|
||||
@@ -1,319 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'create_diet_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateDietModel {
|
||||
String? get imageUrl => throw _privateConstructorUsedError;
|
||||
String? get name => throw _privateConstructorUsedError;
|
||||
String? get details => throw _privateConstructorUsedError;
|
||||
DietState? get state => throw _privateConstructorUsedError;
|
||||
int? get duration => throw _privateConstructorUsedError;
|
||||
Map<String, bool> get type => throw _privateConstructorUsedError;
|
||||
XFile? get image => throw _privateConstructorUsedError;
|
||||
List<List<List<DailySchedule>>>? get dailySchedule =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateDietModelCopyWith<CreateDietModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateDietModelCopyWith<$Res> {
|
||||
factory $CreateDietModelCopyWith(
|
||||
CreateDietModel value, $Res Function(CreateDietModel) then) =
|
||||
_$CreateDietModelCopyWithImpl<$Res, CreateDietModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? imageUrl,
|
||||
String? name,
|
||||
String? details,
|
||||
DietState? state,
|
||||
int? duration,
|
||||
Map<String, bool> type,
|
||||
XFile? image,
|
||||
List<List<List<DailySchedule>>>? dailySchedule});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateDietModelCopyWithImpl<$Res, $Val extends CreateDietModel>
|
||||
implements $CreateDietModelCopyWith<$Res> {
|
||||
_$CreateDietModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? imageUrl = freezed,
|
||||
Object? name = freezed,
|
||||
Object? details = freezed,
|
||||
Object? state = freezed,
|
||||
Object? duration = freezed,
|
||||
Object? type = null,
|
||||
Object? image = freezed,
|
||||
Object? dailySchedule = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
imageUrl: freezed == imageUrl
|
||||
? _value.imageUrl
|
||||
: imageUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
details: freezed == details
|
||||
? _value.details
|
||||
: details // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as DietState?,
|
||||
duration: freezed == duration
|
||||
? _value.duration
|
||||
: duration // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as XFile?,
|
||||
dailySchedule: freezed == dailySchedule
|
||||
? _value.dailySchedule
|
||||
: dailySchedule // ignore: cast_nullable_to_non_nullable
|
||||
as List<List<List<DailySchedule>>>?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateDietModelImplCopyWith<$Res>
|
||||
implements $CreateDietModelCopyWith<$Res> {
|
||||
factory _$$CreateDietModelImplCopyWith(_$CreateDietModelImpl value,
|
||||
$Res Function(_$CreateDietModelImpl) then) =
|
||||
__$$CreateDietModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? imageUrl,
|
||||
String? name,
|
||||
String? details,
|
||||
DietState? state,
|
||||
int? duration,
|
||||
Map<String, bool> type,
|
||||
XFile? image,
|
||||
List<List<List<DailySchedule>>>? dailySchedule});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateDietModelImplCopyWithImpl<$Res>
|
||||
extends _$CreateDietModelCopyWithImpl<$Res, _$CreateDietModelImpl>
|
||||
implements _$$CreateDietModelImplCopyWith<$Res> {
|
||||
__$$CreateDietModelImplCopyWithImpl(
|
||||
_$CreateDietModelImpl _value, $Res Function(_$CreateDietModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? imageUrl = freezed,
|
||||
Object? name = freezed,
|
||||
Object? details = freezed,
|
||||
Object? state = freezed,
|
||||
Object? duration = freezed,
|
||||
Object? type = null,
|
||||
Object? image = freezed,
|
||||
Object? dailySchedule = freezed,
|
||||
}) {
|
||||
return _then(_$CreateDietModelImpl(
|
||||
imageUrl: freezed == imageUrl
|
||||
? _value.imageUrl
|
||||
: imageUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
details: freezed == details
|
||||
? _value.details
|
||||
: details // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as DietState?,
|
||||
duration: freezed == duration
|
||||
? _value.duration
|
||||
: duration // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
type: null == type
|
||||
? _value._type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as XFile?,
|
||||
dailySchedule: freezed == dailySchedule
|
||||
? _value._dailySchedule
|
||||
: dailySchedule // ignore: cast_nullable_to_non_nullable
|
||||
as List<List<List<DailySchedule>>>?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreateDietModelImpl extends _CreateDietModel {
|
||||
const _$CreateDietModelImpl(
|
||||
{this.imageUrl,
|
||||
this.name,
|
||||
this.details,
|
||||
this.state,
|
||||
this.duration,
|
||||
required final Map<String, bool> type,
|
||||
this.image,
|
||||
final List<List<List<DailySchedule>>>? dailySchedule})
|
||||
: _type = type,
|
||||
_dailySchedule = dailySchedule,
|
||||
super._();
|
||||
|
||||
@override
|
||||
final String? imageUrl;
|
||||
@override
|
||||
final String? name;
|
||||
@override
|
||||
final String? details;
|
||||
@override
|
||||
final DietState? state;
|
||||
@override
|
||||
final int? duration;
|
||||
final Map<String, bool> _type;
|
||||
@override
|
||||
Map<String, bool> get type {
|
||||
if (_type is EqualUnmodifiableMapView) return _type;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(_type);
|
||||
}
|
||||
|
||||
@override
|
||||
final XFile? image;
|
||||
final List<List<List<DailySchedule>>>? _dailySchedule;
|
||||
@override
|
||||
List<List<List<DailySchedule>>>? get dailySchedule {
|
||||
final value = _dailySchedule;
|
||||
if (value == null) return null;
|
||||
if (_dailySchedule is EqualUnmodifiableListView) return _dailySchedule;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateDietModel(imageUrl: $imageUrl, name: $name, details: $details, state: $state, duration: $duration, type: $type, image: $image, dailySchedule: $dailySchedule)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateDietModelImpl &&
|
||||
(identical(other.imageUrl, imageUrl) ||
|
||||
other.imageUrl == imageUrl) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.details, details) || other.details == details) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.duration, duration) ||
|
||||
other.duration == duration) &&
|
||||
const DeepCollectionEquality().equals(other._type, _type) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._dailySchedule, _dailySchedule));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
imageUrl,
|
||||
name,
|
||||
details,
|
||||
state,
|
||||
duration,
|
||||
const DeepCollectionEquality().hash(_type),
|
||||
image,
|
||||
const DeepCollectionEquality().hash(_dailySchedule));
|
||||
|
||||
/// Create a copy of CreateDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateDietModelImplCopyWith<_$CreateDietModelImpl> get copyWith =>
|
||||
__$$CreateDietModelImplCopyWithImpl<_$CreateDietModelImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreateDietModel extends CreateDietModel {
|
||||
const factory _CreateDietModel(
|
||||
{final String? imageUrl,
|
||||
final String? name,
|
||||
final String? details,
|
||||
final DietState? state,
|
||||
final int? duration,
|
||||
required final Map<String, bool> type,
|
||||
final XFile? image,
|
||||
final List<List<List<DailySchedule>>>? dailySchedule}) =
|
||||
_$CreateDietModelImpl;
|
||||
const _CreateDietModel._() : super._();
|
||||
|
||||
@override
|
||||
String? get imageUrl;
|
||||
@override
|
||||
String? get name;
|
||||
@override
|
||||
String? get details;
|
||||
@override
|
||||
DietState? get state;
|
||||
@override
|
||||
int? get duration;
|
||||
@override
|
||||
Map<String, bool> get type;
|
||||
@override
|
||||
XFile? get image;
|
||||
@override
|
||||
List<List<List<DailySchedule>>>? get dailySchedule;
|
||||
|
||||
/// Create a copy of CreateDietModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateDietModelImplCopyWith<_$CreateDietModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -188,6 +188,42 @@ class _CreateDietScreenContentState extends State<CreateDietScreenContent> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
CustomOutlinedButton(
|
||||
onPressed: () async {
|
||||
context.read<CreateDietCubit>().setDietState(DietState.draft, state.dietStateIndex ?? 0);
|
||||
if (widget.diet != null) {
|
||||
final result = await context.read<CreateDietCubit>().updateDiet(
|
||||
widget.diet!.id,
|
||||
);
|
||||
if (result == 'error') {
|
||||
if (!context.mounted) return;
|
||||
showErrorDialog(context, title: '${s.could_not_update_diet} ${state.dietData.name}');
|
||||
}
|
||||
} else {
|
||||
final result = await context.read<CreateDietCubit>().createDiet();
|
||||
if (result == 'error') {
|
||||
if (!context.mounted) return;
|
||||
showErrorDialog(context, title: '${s.could_not_publish_diet} ${state.dietData.name}');
|
||||
}
|
||||
}
|
||||
},
|
||||
// onPressed: state.isDietPublishing
|
||||
// ? () {}
|
||||
// : () async {
|
||||
// final diet = await context.read<CreateDietCubit>().getDietForPreview();
|
||||
// if (diet == null) return;
|
||||
// if (!context.mounted) return;
|
||||
// GoRouter.of(context).pushNamed(DietPreviewScreen.name, extra: diet);
|
||||
// },
|
||||
text: "В черновик",
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.gray),
|
||||
buttonStyle: ButtonStyle(
|
||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
||||
backgroundColor: WidgetStatePropertyAll(appTheme.dottedBorder),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
CustomOutlinedButton(
|
||||
onPressed: state.isDietPublishing
|
||||
? () {}
|
||||
|
||||
@@ -1,516 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'create_diet_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateDietState {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
bool get isDietPublishing => throw _privateConstructorUsedError;
|
||||
String? get errorMessage => throw _privateConstructorUsedError;
|
||||
CreateDietModel get dietData => throw _privateConstructorUsedError;
|
||||
List<List<DailySchedule>>? get copiedDay =>
|
||||
throw _privateConstructorUsedError;
|
||||
String? get dietNameError => throw _privateConstructorUsedError;
|
||||
String? get dietDescriptionError => throw _privateConstructorUsedError;
|
||||
String? get dietDurationError => throw _privateConstructorUsedError;
|
||||
String? get dietStateError => throw _privateConstructorUsedError;
|
||||
String? get dietImageError => throw _privateConstructorUsedError;
|
||||
List<String> get dailyScheduleErrors => throw _privateConstructorUsedError;
|
||||
int? get durationIndex => throw _privateConstructorUsedError;
|
||||
int? get dietStateIndex => throw _privateConstructorUsedError;
|
||||
bool get published => throw _privateConstructorUsedError;
|
||||
bool get drafted => throw _privateConstructorUsedError;
|
||||
bool get isDietBeingEdited => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateDietStateCopyWith<CreateDietState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateDietStateCopyWith<$Res> {
|
||||
factory $CreateDietStateCopyWith(
|
||||
CreateDietState value, $Res Function(CreateDietState) then) =
|
||||
_$CreateDietStateCopyWithImpl<$Res, CreateDietState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
bool isDietPublishing,
|
||||
String? errorMessage,
|
||||
CreateDietModel dietData,
|
||||
List<List<DailySchedule>>? copiedDay,
|
||||
String? dietNameError,
|
||||
String? dietDescriptionError,
|
||||
String? dietDurationError,
|
||||
String? dietStateError,
|
||||
String? dietImageError,
|
||||
List<String> dailyScheduleErrors,
|
||||
int? durationIndex,
|
||||
int? dietStateIndex,
|
||||
bool published,
|
||||
bool drafted,
|
||||
bool isDietBeingEdited});
|
||||
|
||||
$CreateDietModelCopyWith<$Res> get dietData;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateDietStateCopyWithImpl<$Res, $Val extends CreateDietState>
|
||||
implements $CreateDietStateCopyWith<$Res> {
|
||||
_$CreateDietStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? isDietPublishing = null,
|
||||
Object? errorMessage = freezed,
|
||||
Object? dietData = null,
|
||||
Object? copiedDay = freezed,
|
||||
Object? dietNameError = freezed,
|
||||
Object? dietDescriptionError = freezed,
|
||||
Object? dietDurationError = freezed,
|
||||
Object? dietStateError = freezed,
|
||||
Object? dietImageError = freezed,
|
||||
Object? dailyScheduleErrors = null,
|
||||
Object? durationIndex = freezed,
|
||||
Object? dietStateIndex = freezed,
|
||||
Object? published = null,
|
||||
Object? drafted = null,
|
||||
Object? isDietBeingEdited = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isDietPublishing: null == isDietPublishing
|
||||
? _value.isDietPublishing
|
||||
: isDietPublishing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietData: null == dietData
|
||||
? _value.dietData
|
||||
: dietData // ignore: cast_nullable_to_non_nullable
|
||||
as CreateDietModel,
|
||||
copiedDay: freezed == copiedDay
|
||||
? _value.copiedDay
|
||||
: copiedDay // ignore: cast_nullable_to_non_nullable
|
||||
as List<List<DailySchedule>>?,
|
||||
dietNameError: freezed == dietNameError
|
||||
? _value.dietNameError
|
||||
: dietNameError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietDescriptionError: freezed == dietDescriptionError
|
||||
? _value.dietDescriptionError
|
||||
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietDurationError: freezed == dietDurationError
|
||||
? _value.dietDurationError
|
||||
: dietDurationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietStateError: freezed == dietStateError
|
||||
? _value.dietStateError
|
||||
: dietStateError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietImageError: freezed == dietImageError
|
||||
? _value.dietImageError
|
||||
: dietImageError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dailyScheduleErrors: null == dailyScheduleErrors
|
||||
? _value.dailyScheduleErrors
|
||||
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
dietStateIndex: freezed == dietStateIndex
|
||||
? _value.dietStateIndex
|
||||
: dietStateIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
published: null == published
|
||||
? _value.published
|
||||
: published // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
drafted: null == drafted
|
||||
? _value.drafted
|
||||
: drafted // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isDietBeingEdited: null == isDietBeingEdited
|
||||
? _value.isDietBeingEdited
|
||||
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CreateDietModelCopyWith<$Res> get dietData {
|
||||
return $CreateDietModelCopyWith<$Res>(_value.dietData, (value) {
|
||||
return _then(_value.copyWith(dietData: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateDietStateImplCopyWith<$Res>
|
||||
implements $CreateDietStateCopyWith<$Res> {
|
||||
factory _$$CreateDietStateImplCopyWith(_$CreateDietStateImpl value,
|
||||
$Res Function(_$CreateDietStateImpl) then) =
|
||||
__$$CreateDietStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
bool isDietPublishing,
|
||||
String? errorMessage,
|
||||
CreateDietModel dietData,
|
||||
List<List<DailySchedule>>? copiedDay,
|
||||
String? dietNameError,
|
||||
String? dietDescriptionError,
|
||||
String? dietDurationError,
|
||||
String? dietStateError,
|
||||
String? dietImageError,
|
||||
List<String> dailyScheduleErrors,
|
||||
int? durationIndex,
|
||||
int? dietStateIndex,
|
||||
bool published,
|
||||
bool drafted,
|
||||
bool isDietBeingEdited});
|
||||
|
||||
@override
|
||||
$CreateDietModelCopyWith<$Res> get dietData;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateDietStateImplCopyWithImpl<$Res>
|
||||
extends _$CreateDietStateCopyWithImpl<$Res, _$CreateDietStateImpl>
|
||||
implements _$$CreateDietStateImplCopyWith<$Res> {
|
||||
__$$CreateDietStateImplCopyWithImpl(
|
||||
_$CreateDietStateImpl _value, $Res Function(_$CreateDietStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? isDietPublishing = null,
|
||||
Object? errorMessage = freezed,
|
||||
Object? dietData = null,
|
||||
Object? copiedDay = freezed,
|
||||
Object? dietNameError = freezed,
|
||||
Object? dietDescriptionError = freezed,
|
||||
Object? dietDurationError = freezed,
|
||||
Object? dietStateError = freezed,
|
||||
Object? dietImageError = freezed,
|
||||
Object? dailyScheduleErrors = null,
|
||||
Object? durationIndex = freezed,
|
||||
Object? dietStateIndex = freezed,
|
||||
Object? published = null,
|
||||
Object? drafted = null,
|
||||
Object? isDietBeingEdited = null,
|
||||
}) {
|
||||
return _then(_$CreateDietStateImpl(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isDietPublishing: null == isDietPublishing
|
||||
? _value.isDietPublishing
|
||||
: isDietPublishing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietData: null == dietData
|
||||
? _value.dietData
|
||||
: dietData // ignore: cast_nullable_to_non_nullable
|
||||
as CreateDietModel,
|
||||
copiedDay: freezed == copiedDay
|
||||
? _value._copiedDay
|
||||
: copiedDay // ignore: cast_nullable_to_non_nullable
|
||||
as List<List<DailySchedule>>?,
|
||||
dietNameError: freezed == dietNameError
|
||||
? _value.dietNameError
|
||||
: dietNameError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietDescriptionError: freezed == dietDescriptionError
|
||||
? _value.dietDescriptionError
|
||||
: dietDescriptionError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietDurationError: freezed == dietDurationError
|
||||
? _value.dietDurationError
|
||||
: dietDurationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietStateError: freezed == dietStateError
|
||||
? _value.dietStateError
|
||||
: dietStateError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dietImageError: freezed == dietImageError
|
||||
? _value.dietImageError
|
||||
: dietImageError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
dailyScheduleErrors: null == dailyScheduleErrors
|
||||
? _value._dailyScheduleErrors
|
||||
: dailyScheduleErrors // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
dietStateIndex: freezed == dietStateIndex
|
||||
? _value.dietStateIndex
|
||||
: dietStateIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
published: null == published
|
||||
? _value.published
|
||||
: published // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
drafted: null == drafted
|
||||
? _value.drafted
|
||||
: drafted // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
isDietBeingEdited: null == isDietBeingEdited
|
||||
? _value.isDietBeingEdited
|
||||
: isDietBeingEdited // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreateDietStateImpl implements _CreateDietState {
|
||||
const _$CreateDietStateImpl(
|
||||
{required this.isLoading,
|
||||
required this.isDietPublishing,
|
||||
required this.errorMessage,
|
||||
required this.dietData,
|
||||
final List<List<DailySchedule>>? copiedDay,
|
||||
this.dietNameError,
|
||||
this.dietDescriptionError,
|
||||
this.dietDurationError,
|
||||
this.dietStateError,
|
||||
this.dietImageError,
|
||||
required final List<String> dailyScheduleErrors,
|
||||
this.durationIndex,
|
||||
this.dietStateIndex,
|
||||
this.published = false,
|
||||
this.drafted = false,
|
||||
this.isDietBeingEdited = false})
|
||||
: _copiedDay = copiedDay,
|
||||
_dailyScheduleErrors = dailyScheduleErrors;
|
||||
|
||||
@override
|
||||
final bool isLoading;
|
||||
@override
|
||||
final bool isDietPublishing;
|
||||
@override
|
||||
final String? errorMessage;
|
||||
@override
|
||||
final CreateDietModel dietData;
|
||||
final List<List<DailySchedule>>? _copiedDay;
|
||||
@override
|
||||
List<List<DailySchedule>>? get copiedDay {
|
||||
final value = _copiedDay;
|
||||
if (value == null) return null;
|
||||
if (_copiedDay is EqualUnmodifiableListView) return _copiedDay;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
final String? dietNameError;
|
||||
@override
|
||||
final String? dietDescriptionError;
|
||||
@override
|
||||
final String? dietDurationError;
|
||||
@override
|
||||
final String? dietStateError;
|
||||
@override
|
||||
final String? dietImageError;
|
||||
final List<String> _dailyScheduleErrors;
|
||||
@override
|
||||
List<String> get dailyScheduleErrors {
|
||||
if (_dailyScheduleErrors is EqualUnmodifiableListView)
|
||||
return _dailyScheduleErrors;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_dailyScheduleErrors);
|
||||
}
|
||||
|
||||
@override
|
||||
final int? durationIndex;
|
||||
@override
|
||||
final int? dietStateIndex;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool published;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool drafted;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isDietBeingEdited;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateDietState(isLoading: $isLoading, isDietPublishing: $isDietPublishing, errorMessage: $errorMessage, dietData: $dietData, copiedDay: $copiedDay, dietNameError: $dietNameError, dietDescriptionError: $dietDescriptionError, dietDurationError: $dietDurationError, dietStateError: $dietStateError, dietImageError: $dietImageError, dailyScheduleErrors: $dailyScheduleErrors, durationIndex: $durationIndex, dietStateIndex: $dietStateIndex, published: $published, drafted: $drafted, isDietBeingEdited: $isDietBeingEdited)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateDietStateImpl &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
(identical(other.isDietPublishing, isDietPublishing) ||
|
||||
other.isDietPublishing == isDietPublishing) &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage) &&
|
||||
(identical(other.dietData, dietData) ||
|
||||
other.dietData == dietData) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._copiedDay, _copiedDay) &&
|
||||
(identical(other.dietNameError, dietNameError) ||
|
||||
other.dietNameError == dietNameError) &&
|
||||
(identical(other.dietDescriptionError, dietDescriptionError) ||
|
||||
other.dietDescriptionError == dietDescriptionError) &&
|
||||
(identical(other.dietDurationError, dietDurationError) ||
|
||||
other.dietDurationError == dietDurationError) &&
|
||||
(identical(other.dietStateError, dietStateError) ||
|
||||
other.dietStateError == dietStateError) &&
|
||||
(identical(other.dietImageError, dietImageError) ||
|
||||
other.dietImageError == dietImageError) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._dailyScheduleErrors, _dailyScheduleErrors) &&
|
||||
(identical(other.durationIndex, durationIndex) ||
|
||||
other.durationIndex == durationIndex) &&
|
||||
(identical(other.dietStateIndex, dietStateIndex) ||
|
||||
other.dietStateIndex == dietStateIndex) &&
|
||||
(identical(other.published, published) ||
|
||||
other.published == published) &&
|
||||
(identical(other.drafted, drafted) || other.drafted == drafted) &&
|
||||
(identical(other.isDietBeingEdited, isDietBeingEdited) ||
|
||||
other.isDietBeingEdited == isDietBeingEdited));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
isLoading,
|
||||
isDietPublishing,
|
||||
errorMessage,
|
||||
dietData,
|
||||
const DeepCollectionEquality().hash(_copiedDay),
|
||||
dietNameError,
|
||||
dietDescriptionError,
|
||||
dietDurationError,
|
||||
dietStateError,
|
||||
dietImageError,
|
||||
const DeepCollectionEquality().hash(_dailyScheduleErrors),
|
||||
durationIndex,
|
||||
dietStateIndex,
|
||||
published,
|
||||
drafted,
|
||||
isDietBeingEdited);
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateDietStateImplCopyWith<_$CreateDietStateImpl> get copyWith =>
|
||||
__$$CreateDietStateImplCopyWithImpl<_$CreateDietStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreateDietState implements CreateDietState {
|
||||
const factory _CreateDietState(
|
||||
{required final bool isLoading,
|
||||
required final bool isDietPublishing,
|
||||
required final String? errorMessage,
|
||||
required final CreateDietModel dietData,
|
||||
final List<List<DailySchedule>>? copiedDay,
|
||||
final String? dietNameError,
|
||||
final String? dietDescriptionError,
|
||||
final String? dietDurationError,
|
||||
final String? dietStateError,
|
||||
final String? dietImageError,
|
||||
required final List<String> dailyScheduleErrors,
|
||||
final int? durationIndex,
|
||||
final int? dietStateIndex,
|
||||
final bool published,
|
||||
final bool drafted,
|
||||
final bool isDietBeingEdited}) = _$CreateDietStateImpl;
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
bool get isDietPublishing;
|
||||
@override
|
||||
String? get errorMessage;
|
||||
@override
|
||||
CreateDietModel get dietData;
|
||||
@override
|
||||
List<List<DailySchedule>>? get copiedDay;
|
||||
@override
|
||||
String? get dietNameError;
|
||||
@override
|
||||
String? get dietDescriptionError;
|
||||
@override
|
||||
String? get dietDurationError;
|
||||
@override
|
||||
String? get dietStateError;
|
||||
@override
|
||||
String? get dietImageError;
|
||||
@override
|
||||
List<String> get dailyScheduleErrors;
|
||||
@override
|
||||
int? get durationIndex;
|
||||
@override
|
||||
int? get dietStateIndex;
|
||||
@override
|
||||
bool get published;
|
||||
@override
|
||||
bool get drafted;
|
||||
@override
|
||||
bool get isDietBeingEdited;
|
||||
|
||||
/// Create a copy of CreateDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateDietStateImplCopyWith<_$CreateDietStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -19,23 +19,25 @@ class StatusDropDownWidget extends StatefulWidget {
|
||||
|
||||
class _StatusDropDownWidgetState extends State<StatusDropDownWidget> {
|
||||
final List<String> dietStateTitles = [];
|
||||
late final List<DietState> dietStates = DietState.values;
|
||||
// late final List<DietState> dietStates = DietState.values;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
final s = S.of(context);
|
||||
if (dietStateTitles.isEmpty) {
|
||||
for (var elem in dietStates) {
|
||||
switch (elem) {
|
||||
case DietState.active:
|
||||
dietStateTitles.add(s.active_diet_state);
|
||||
case DietState.draft:
|
||||
dietStateTitles.add(s.draft);
|
||||
case DietState.personal:
|
||||
dietStateTitles.add(s.personal_diet_state);
|
||||
}
|
||||
}
|
||||
dietStateTitles.add(s.public_diet_state);
|
||||
dietStateTitles.add(s.personal_diet_state);
|
||||
// for (var elem in dietStates) {
|
||||
// switch (elem) {
|
||||
// case DietState.active:
|
||||
// dietStateTitles.add(s.active_diet_state);
|
||||
// case DietState.draft:
|
||||
// dietStateTitles.add(s.draft);
|
||||
// case DietState.personal:
|
||||
// dietStateTitles.add(s.personal_diet_state);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,14 +57,19 @@ class _StatusDropDownWidgetState extends State<StatusDropDownWidget> {
|
||||
),
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
final index = dietStates.indexOf(value);
|
||||
context.read<CreateDietCubit>().setDietState(value, index);
|
||||
if (value == s.public_diet_state) {
|
||||
context.read<CreateDietCubit>().setDietState(DietState.active, 0);
|
||||
} else {
|
||||
context.read<CreateDietCubit>().setDietState(DietState.personal, 1);
|
||||
}
|
||||
// final index = dietStates.indexOf(value);
|
||||
// context.read<CreateDietCubit>().setDietState(value, index);
|
||||
}
|
||||
},
|
||||
items: dietStateTitles
|
||||
.mapIndexed(
|
||||
(index, value) => DropdownMenuItem(
|
||||
value: dietStates[index],
|
||||
value: dietStateTitles[index],
|
||||
child: Text(
|
||||
dietStateTitles[index],
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.black),
|
||||
@@ -70,7 +77,7 @@ class _StatusDropDownWidgetState extends State<StatusDropDownWidget> {
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
value: state.dietStateIndex == null ? null : dietStates[state.dietStateIndex ?? 0],
|
||||
value: state.dietStateIndex == null ? null : dietStateTitles[state.dietStateIndex ?? 0],
|
||||
),
|
||||
if (state.dietStateError != null) ...[
|
||||
const SizedBox(
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'create_diet_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _CreateDietService implements CreateDietService {
|
||||
_CreateDietService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<CreatedDiet> createPublishedDiet({required FormData formData}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<CreatedDiet>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/create/published',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late CreatedDiet _value;
|
||||
try {
|
||||
_value = CreatedDiet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CreatedDiet> createDraftedDiet({required FormData formData}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<CreatedDiet>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/create/drafted',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late CreatedDiet _value;
|
||||
try {
|
||||
_value = CreatedDiet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CreatedDiet> createPersonalDiet({required FormData formData}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<CreatedDiet>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/create/personalized',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late CreatedDiet _value;
|
||||
try {
|
||||
_value = CreatedDiet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updatePublished({
|
||||
required int diet,
|
||||
required FormData formData,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/update/published/${diet}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateDrafted({
|
||||
required int diet,
|
||||
required FormData formData,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/update/drafted/${diet}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updatePersonal({
|
||||
required int diet,
|
||||
required FormData formData,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/update/personalized/${diet}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<HttpResponse<dynamic>> getDietPortionsNutrition({
|
||||
required int diet,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<HttpResponse<dynamic>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/show/${diet}/per_portion_nutritions',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch(_options);
|
||||
final _value = _result.data;
|
||||
final httpResponse = HttpResponse(_value, _result);
|
||||
return httpResponse;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'create_plan_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreatePlanModel {
|
||||
String? get name => throw _privateConstructorUsedError;
|
||||
String? get details => throw _privateConstructorUsedError;
|
||||
String? get state => throw _privateConstructorUsedError;
|
||||
int? get duration => throw _privateConstructorUsedError;
|
||||
List<bool> get type => throw _privateConstructorUsedError;
|
||||
XFile? get image => throw _privateConstructorUsedError;
|
||||
List<PacketOptions> get options => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreatePlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreatePlanModelCopyWith<CreatePlanModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreatePlanModelCopyWith<$Res> {
|
||||
factory $CreatePlanModelCopyWith(
|
||||
CreatePlanModel value, $Res Function(CreatePlanModel) then) =
|
||||
_$CreatePlanModelCopyWithImpl<$Res, CreatePlanModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? name,
|
||||
String? details,
|
||||
String? state,
|
||||
int? duration,
|
||||
List<bool> type,
|
||||
XFile? image,
|
||||
List<PacketOptions> options});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreatePlanModelCopyWithImpl<$Res, $Val extends CreatePlanModel>
|
||||
implements $CreatePlanModelCopyWith<$Res> {
|
||||
_$CreatePlanModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreatePlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = freezed,
|
||||
Object? details = freezed,
|
||||
Object? state = freezed,
|
||||
Object? duration = freezed,
|
||||
Object? type = null,
|
||||
Object? image = freezed,
|
||||
Object? options = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
details: freezed == details
|
||||
? _value.details
|
||||
: details // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
duration: freezed == duration
|
||||
? _value.duration
|
||||
: duration // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as List<bool>,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as XFile?,
|
||||
options: null == options
|
||||
? _value.options
|
||||
: options // ignore: cast_nullable_to_non_nullable
|
||||
as List<PacketOptions>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreatePlanModelImplCopyWith<$Res>
|
||||
implements $CreatePlanModelCopyWith<$Res> {
|
||||
factory _$$CreatePlanModelImplCopyWith(_$CreatePlanModelImpl value,
|
||||
$Res Function(_$CreatePlanModelImpl) then) =
|
||||
__$$CreatePlanModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? name,
|
||||
String? details,
|
||||
String? state,
|
||||
int? duration,
|
||||
List<bool> type,
|
||||
XFile? image,
|
||||
List<PacketOptions> options});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreatePlanModelImplCopyWithImpl<$Res>
|
||||
extends _$CreatePlanModelCopyWithImpl<$Res, _$CreatePlanModelImpl>
|
||||
implements _$$CreatePlanModelImplCopyWith<$Res> {
|
||||
__$$CreatePlanModelImplCopyWithImpl(
|
||||
_$CreatePlanModelImpl _value, $Res Function(_$CreatePlanModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreatePlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = freezed,
|
||||
Object? details = freezed,
|
||||
Object? state = freezed,
|
||||
Object? duration = freezed,
|
||||
Object? type = null,
|
||||
Object? image = freezed,
|
||||
Object? options = null,
|
||||
}) {
|
||||
return _then(_$CreatePlanModelImpl(
|
||||
name: freezed == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
details: freezed == details
|
||||
? _value.details
|
||||
: details // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
duration: freezed == duration
|
||||
? _value.duration
|
||||
: duration // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
type: null == type
|
||||
? _value._type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as List<bool>,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as XFile?,
|
||||
options: null == options
|
||||
? _value._options
|
||||
: options // ignore: cast_nullable_to_non_nullable
|
||||
as List<PacketOptions>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreatePlanModelImpl extends _CreatePlanModel {
|
||||
const _$CreatePlanModelImpl(
|
||||
{this.name,
|
||||
this.details,
|
||||
this.state,
|
||||
this.duration,
|
||||
required final List<bool> type,
|
||||
this.image,
|
||||
required final List<PacketOptions> options})
|
||||
: _type = type,
|
||||
_options = options,
|
||||
super._();
|
||||
|
||||
@override
|
||||
final String? name;
|
||||
@override
|
||||
final String? details;
|
||||
@override
|
||||
final String? state;
|
||||
@override
|
||||
final int? duration;
|
||||
final List<bool> _type;
|
||||
@override
|
||||
List<bool> get type {
|
||||
if (_type is EqualUnmodifiableListView) return _type;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_type);
|
||||
}
|
||||
|
||||
@override
|
||||
final XFile? image;
|
||||
final List<PacketOptions> _options;
|
||||
@override
|
||||
List<PacketOptions> get options {
|
||||
if (_options is EqualUnmodifiableListView) return _options;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreatePlanModel(name: $name, details: $details, state: $state, duration: $duration, type: $type, image: $image, options: $options)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreatePlanModelImpl &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.details, details) || other.details == details) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.duration, duration) ||
|
||||
other.duration == duration) &&
|
||||
const DeepCollectionEquality().equals(other._type, _type) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
const DeepCollectionEquality().equals(other._options, _options));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
name,
|
||||
details,
|
||||
state,
|
||||
duration,
|
||||
const DeepCollectionEquality().hash(_type),
|
||||
image,
|
||||
const DeepCollectionEquality().hash(_options));
|
||||
|
||||
/// Create a copy of CreatePlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreatePlanModelImplCopyWith<_$CreatePlanModelImpl> get copyWith =>
|
||||
__$$CreatePlanModelImplCopyWithImpl<_$CreatePlanModelImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreatePlanModel extends CreatePlanModel {
|
||||
const factory _CreatePlanModel(
|
||||
{final String? name,
|
||||
final String? details,
|
||||
final String? state,
|
||||
final int? duration,
|
||||
required final List<bool> type,
|
||||
final XFile? image,
|
||||
required final List<PacketOptions> options}) = _$CreatePlanModelImpl;
|
||||
const _CreatePlanModel._() : super._();
|
||||
|
||||
@override
|
||||
String? get name;
|
||||
@override
|
||||
String? get details;
|
||||
@override
|
||||
String? get state;
|
||||
@override
|
||||
int? get duration;
|
||||
@override
|
||||
List<bool> get type;
|
||||
@override
|
||||
XFile? get image;
|
||||
@override
|
||||
List<PacketOptions> get options;
|
||||
|
||||
/// Create a copy of CreatePlanModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreatePlanModelImplCopyWith<_$CreatePlanModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'create_plan_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreatePlanState {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
String? get errorMessage => throw _privateConstructorUsedError;
|
||||
CreatePlanModel get planData => throw _privateConstructorUsedError;
|
||||
int? get durationIndex => throw _privateConstructorUsedError;
|
||||
int? get selectedOptionIndex => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreatePlanStateCopyWith<CreatePlanState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreatePlanStateCopyWith<$Res> {
|
||||
factory $CreatePlanStateCopyWith(
|
||||
CreatePlanState value, $Res Function(CreatePlanState) then) =
|
||||
_$CreatePlanStateCopyWithImpl<$Res, CreatePlanState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex});
|
||||
|
||||
$CreatePlanModelCopyWith<$Res> get planData;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreatePlanStateCopyWithImpl<$Res, $Val extends CreatePlanState>
|
||||
implements $CreatePlanStateCopyWith<$Res> {
|
||||
_$CreatePlanStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? errorMessage = freezed,
|
||||
Object? planData = null,
|
||||
Object? durationIndex = freezed,
|
||||
Object? selectedOptionIndex = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData: null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex: freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CreatePlanModelCopyWith<$Res> get planData {
|
||||
return $CreatePlanModelCopyWith<$Res>(_value.planData, (value) {
|
||||
return _then(_value.copyWith(planData: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreatePlanStateImplCopyWith<$Res>
|
||||
implements $CreatePlanStateCopyWith<$Res> {
|
||||
factory _$$CreatePlanStateImplCopyWith(_$CreatePlanStateImpl value,
|
||||
$Res Function(_$CreatePlanStateImpl) then) =
|
||||
__$$CreatePlanStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
String? errorMessage,
|
||||
CreatePlanModel planData,
|
||||
int? durationIndex,
|
||||
int? selectedOptionIndex});
|
||||
|
||||
@override
|
||||
$CreatePlanModelCopyWith<$Res> get planData;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreatePlanStateImplCopyWithImpl<$Res>
|
||||
extends _$CreatePlanStateCopyWithImpl<$Res, _$CreatePlanStateImpl>
|
||||
implements _$$CreatePlanStateImplCopyWith<$Res> {
|
||||
__$$CreatePlanStateImplCopyWithImpl(
|
||||
_$CreatePlanStateImpl _value, $Res Function(_$CreatePlanStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? errorMessage = freezed,
|
||||
Object? planData = null,
|
||||
Object? durationIndex = freezed,
|
||||
Object? selectedOptionIndex = freezed,
|
||||
}) {
|
||||
return _then(_$CreatePlanStateImpl(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
errorMessage: freezed == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
planData: null == planData
|
||||
? _value.planData
|
||||
: planData // ignore: cast_nullable_to_non_nullable
|
||||
as CreatePlanModel,
|
||||
durationIndex: freezed == durationIndex
|
||||
? _value.durationIndex
|
||||
: durationIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
selectedOptionIndex: freezed == selectedOptionIndex
|
||||
? _value.selectedOptionIndex
|
||||
: selectedOptionIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreatePlanStateImpl implements _CreatePlanState {
|
||||
const _$CreatePlanStateImpl(
|
||||
{required this.isLoading,
|
||||
required this.errorMessage,
|
||||
required this.planData,
|
||||
this.durationIndex,
|
||||
this.selectedOptionIndex});
|
||||
|
||||
@override
|
||||
final bool isLoading;
|
||||
@override
|
||||
final String? errorMessage;
|
||||
@override
|
||||
final CreatePlanModel planData;
|
||||
@override
|
||||
final int? durationIndex;
|
||||
@override
|
||||
final int? selectedOptionIndex;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreatePlanState(isLoading: $isLoading, errorMessage: $errorMessage, planData: $planData, durationIndex: $durationIndex, selectedOptionIndex: $selectedOptionIndex)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreatePlanStateImpl &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage) &&
|
||||
(identical(other.planData, planData) ||
|
||||
other.planData == planData) &&
|
||||
(identical(other.durationIndex, durationIndex) ||
|
||||
other.durationIndex == durationIndex) &&
|
||||
(identical(other.selectedOptionIndex, selectedOptionIndex) ||
|
||||
other.selectedOptionIndex == selectedOptionIndex));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, isLoading, errorMessage,
|
||||
planData, durationIndex, selectedOptionIndex);
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreatePlanStateImplCopyWith<_$CreatePlanStateImpl> get copyWith =>
|
||||
__$$CreatePlanStateImplCopyWithImpl<_$CreatePlanStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreatePlanState implements CreatePlanState {
|
||||
const factory _CreatePlanState(
|
||||
{required final bool isLoading,
|
||||
required final String? errorMessage,
|
||||
required final CreatePlanModel planData,
|
||||
final int? durationIndex,
|
||||
final int? selectedOptionIndex}) = _$CreatePlanStateImpl;
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
String? get errorMessage;
|
||||
@override
|
||||
CreatePlanModel get planData;
|
||||
@override
|
||||
int? get durationIndex;
|
||||
@override
|
||||
int? get selectedOptionIndex;
|
||||
|
||||
/// Create a copy of CreatePlanState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreatePlanStateImplCopyWith<_$CreatePlanStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'create_plan_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _CreatePlanService implements CreatePlanService {
|
||||
_CreatePlanService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> createPlan({required Map<String, dynamic> model}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(model);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/plans/create',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createPacketOption({
|
||||
required String slug,
|
||||
required Map<String, dynamic> model,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(model);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/plans/create/${slug}/packet_option',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createPacketOptions({
|
||||
required String slug,
|
||||
required Map<String, dynamic> model,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(model);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/plans/create/${slug}/packet_options',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,602 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'recipe_create_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RecipeCreateEntity {
|
||||
String? get title => throw _privateConstructorUsedError;
|
||||
TypeOfRecipe? get typeOfRecipe => throw _privateConstructorUsedError;
|
||||
int? get countOfPortions => throw _privateConstructorUsedError;
|
||||
double? get energyInOnePortion => throw _privateConstructorUsedError;
|
||||
int? get totalCookHours => throw _privateConstructorUsedError;
|
||||
int? get totalCookMinutes => throw _privateConstructorUsedError;
|
||||
int? get activeCookHours => throw _privateConstructorUsedError;
|
||||
int? get activeCookMinutes => throw _privateConstructorUsedError;
|
||||
String? get description => throw _privateConstructorUsedError;
|
||||
File? get image => throw _privateConstructorUsedError;
|
||||
String? get videoUrl => throw _privateConstructorUsedError;
|
||||
List<Ingredient> get ingredients => throw _privateConstructorUsedError;
|
||||
List<StepEntity> get steps => throw _privateConstructorUsedError;
|
||||
List<String> get tags => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RecipeCreateEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RecipeCreateEntityCopyWith<RecipeCreateEntity> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipeCreateEntityCopyWith<$Res> {
|
||||
factory $RecipeCreateEntityCopyWith(
|
||||
RecipeCreateEntity value, $Res Function(RecipeCreateEntity) then) =
|
||||
_$RecipeCreateEntityCopyWithImpl<$Res, RecipeCreateEntity>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? title,
|
||||
TypeOfRecipe? typeOfRecipe,
|
||||
int? countOfPortions,
|
||||
double? energyInOnePortion,
|
||||
int? totalCookHours,
|
||||
int? totalCookMinutes,
|
||||
int? activeCookHours,
|
||||
int? activeCookMinutes,
|
||||
String? description,
|
||||
File? image,
|
||||
String? videoUrl,
|
||||
List<Ingredient> ingredients,
|
||||
List<StepEntity> steps,
|
||||
List<String> tags});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipeCreateEntityCopyWithImpl<$Res, $Val extends RecipeCreateEntity>
|
||||
implements $RecipeCreateEntityCopyWith<$Res> {
|
||||
_$RecipeCreateEntityCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RecipeCreateEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = freezed,
|
||||
Object? typeOfRecipe = freezed,
|
||||
Object? countOfPortions = freezed,
|
||||
Object? energyInOnePortion = freezed,
|
||||
Object? totalCookHours = freezed,
|
||||
Object? totalCookMinutes = freezed,
|
||||
Object? activeCookHours = freezed,
|
||||
Object? activeCookMinutes = freezed,
|
||||
Object? description = freezed,
|
||||
Object? image = freezed,
|
||||
Object? videoUrl = freezed,
|
||||
Object? ingredients = null,
|
||||
Object? steps = null,
|
||||
Object? tags = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
title: freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
typeOfRecipe: freezed == typeOfRecipe
|
||||
? _value.typeOfRecipe
|
||||
: typeOfRecipe // ignore: cast_nullable_to_non_nullable
|
||||
as TypeOfRecipe?,
|
||||
countOfPortions: freezed == countOfPortions
|
||||
? _value.countOfPortions
|
||||
: countOfPortions // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
energyInOnePortion: freezed == energyInOnePortion
|
||||
? _value.energyInOnePortion
|
||||
: energyInOnePortion // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
totalCookHours: freezed == totalCookHours
|
||||
? _value.totalCookHours
|
||||
: totalCookHours // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalCookMinutes: freezed == totalCookMinutes
|
||||
? _value.totalCookMinutes
|
||||
: totalCookMinutes // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookHours: freezed == activeCookHours
|
||||
? _value.activeCookHours
|
||||
: activeCookHours // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookMinutes: freezed == activeCookMinutes
|
||||
? _value.activeCookMinutes
|
||||
: activeCookMinutes // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as File?,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
ingredients: null == ingredients
|
||||
? _value.ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient>,
|
||||
steps: null == steps
|
||||
? _value.steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<StepEntity>,
|
||||
tags: null == tags
|
||||
? _value.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeCreateEntityImplCopyWith<$Res>
|
||||
implements $RecipeCreateEntityCopyWith<$Res> {
|
||||
factory _$$RecipeCreateEntityImplCopyWith(_$RecipeCreateEntityImpl value,
|
||||
$Res Function(_$RecipeCreateEntityImpl) then) =
|
||||
__$$RecipeCreateEntityImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String? title,
|
||||
TypeOfRecipe? typeOfRecipe,
|
||||
int? countOfPortions,
|
||||
double? energyInOnePortion,
|
||||
int? totalCookHours,
|
||||
int? totalCookMinutes,
|
||||
int? activeCookHours,
|
||||
int? activeCookMinutes,
|
||||
String? description,
|
||||
File? image,
|
||||
String? videoUrl,
|
||||
List<Ingredient> ingredients,
|
||||
List<StepEntity> steps,
|
||||
List<String> tags});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeCreateEntityImplCopyWithImpl<$Res>
|
||||
extends _$RecipeCreateEntityCopyWithImpl<$Res, _$RecipeCreateEntityImpl>
|
||||
implements _$$RecipeCreateEntityImplCopyWith<$Res> {
|
||||
__$$RecipeCreateEntityImplCopyWithImpl(_$RecipeCreateEntityImpl _value,
|
||||
$Res Function(_$RecipeCreateEntityImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RecipeCreateEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = freezed,
|
||||
Object? typeOfRecipe = freezed,
|
||||
Object? countOfPortions = freezed,
|
||||
Object? energyInOnePortion = freezed,
|
||||
Object? totalCookHours = freezed,
|
||||
Object? totalCookMinutes = freezed,
|
||||
Object? activeCookHours = freezed,
|
||||
Object? activeCookMinutes = freezed,
|
||||
Object? description = freezed,
|
||||
Object? image = freezed,
|
||||
Object? videoUrl = freezed,
|
||||
Object? ingredients = null,
|
||||
Object? steps = null,
|
||||
Object? tags = null,
|
||||
}) {
|
||||
return _then(_$RecipeCreateEntityImpl(
|
||||
title: freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
typeOfRecipe: freezed == typeOfRecipe
|
||||
? _value.typeOfRecipe
|
||||
: typeOfRecipe // ignore: cast_nullable_to_non_nullable
|
||||
as TypeOfRecipe?,
|
||||
countOfPortions: freezed == countOfPortions
|
||||
? _value.countOfPortions
|
||||
: countOfPortions // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
energyInOnePortion: freezed == energyInOnePortion
|
||||
? _value.energyInOnePortion
|
||||
: energyInOnePortion // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
totalCookHours: freezed == totalCookHours
|
||||
? _value.totalCookHours
|
||||
: totalCookHours // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalCookMinutes: freezed == totalCookMinutes
|
||||
? _value.totalCookMinutes
|
||||
: totalCookMinutes // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookHours: freezed == activeCookHours
|
||||
? _value.activeCookHours
|
||||
: activeCookHours // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookMinutes: freezed == activeCookMinutes
|
||||
? _value.activeCookMinutes
|
||||
: activeCookMinutes // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as File?,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
ingredients: null == ingredients
|
||||
? _value._ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient>,
|
||||
steps: null == steps
|
||||
? _value._steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<StepEntity>,
|
||||
tags: null == tags
|
||||
? _value._tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$RecipeCreateEntityImpl extends _RecipeCreateEntity {
|
||||
const _$RecipeCreateEntityImpl(
|
||||
{this.title,
|
||||
this.typeOfRecipe,
|
||||
this.countOfPortions,
|
||||
this.energyInOnePortion,
|
||||
this.totalCookHours,
|
||||
this.totalCookMinutes,
|
||||
this.activeCookHours,
|
||||
this.activeCookMinutes,
|
||||
this.description,
|
||||
this.image,
|
||||
this.videoUrl,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final List<StepEntity> steps,
|
||||
required final List<String> tags})
|
||||
: _ingredients = ingredients,
|
||||
_steps = steps,
|
||||
_tags = tags,
|
||||
super._();
|
||||
|
||||
@override
|
||||
final String? title;
|
||||
@override
|
||||
final TypeOfRecipe? typeOfRecipe;
|
||||
@override
|
||||
final int? countOfPortions;
|
||||
@override
|
||||
final double? energyInOnePortion;
|
||||
@override
|
||||
final int? totalCookHours;
|
||||
@override
|
||||
final int? totalCookMinutes;
|
||||
@override
|
||||
final int? activeCookHours;
|
||||
@override
|
||||
final int? activeCookMinutes;
|
||||
@override
|
||||
final String? description;
|
||||
@override
|
||||
final File? image;
|
||||
@override
|
||||
final String? videoUrl;
|
||||
final List<Ingredient> _ingredients;
|
||||
@override
|
||||
List<Ingredient> get ingredients {
|
||||
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_ingredients);
|
||||
}
|
||||
|
||||
final List<StepEntity> _steps;
|
||||
@override
|
||||
List<StepEntity> get steps {
|
||||
if (_steps is EqualUnmodifiableListView) return _steps;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_steps);
|
||||
}
|
||||
|
||||
final List<String> _tags;
|
||||
@override
|
||||
List<String> get tags {
|
||||
if (_tags is EqualUnmodifiableListView) return _tags;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_tags);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RecipeCreateEntity(title: $title, typeOfRecipe: $typeOfRecipe, countOfPortions: $countOfPortions, energyInOnePortion: $energyInOnePortion, totalCookHours: $totalCookHours, totalCookMinutes: $totalCookMinutes, activeCookHours: $activeCookHours, activeCookMinutes: $activeCookMinutes, description: $description, image: $image, videoUrl: $videoUrl, ingredients: $ingredients, steps: $steps, tags: $tags)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeCreateEntityImpl &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.typeOfRecipe, typeOfRecipe) ||
|
||||
other.typeOfRecipe == typeOfRecipe) &&
|
||||
(identical(other.countOfPortions, countOfPortions) ||
|
||||
other.countOfPortions == countOfPortions) &&
|
||||
(identical(other.energyInOnePortion, energyInOnePortion) ||
|
||||
other.energyInOnePortion == energyInOnePortion) &&
|
||||
(identical(other.totalCookHours, totalCookHours) ||
|
||||
other.totalCookHours == totalCookHours) &&
|
||||
(identical(other.totalCookMinutes, totalCookMinutes) ||
|
||||
other.totalCookMinutes == totalCookMinutes) &&
|
||||
(identical(other.activeCookHours, activeCookHours) ||
|
||||
other.activeCookHours == activeCookHours) &&
|
||||
(identical(other.activeCookMinutes, activeCookMinutes) ||
|
||||
other.activeCookMinutes == activeCookMinutes) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.videoUrl, videoUrl) ||
|
||||
other.videoUrl == videoUrl) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._ingredients, _ingredients) &&
|
||||
const DeepCollectionEquality().equals(other._steps, _steps) &&
|
||||
const DeepCollectionEquality().equals(other._tags, _tags));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
title,
|
||||
typeOfRecipe,
|
||||
countOfPortions,
|
||||
energyInOnePortion,
|
||||
totalCookHours,
|
||||
totalCookMinutes,
|
||||
activeCookHours,
|
||||
activeCookMinutes,
|
||||
description,
|
||||
image,
|
||||
videoUrl,
|
||||
const DeepCollectionEquality().hash(_ingredients),
|
||||
const DeepCollectionEquality().hash(_steps),
|
||||
const DeepCollectionEquality().hash(_tags));
|
||||
|
||||
/// Create a copy of RecipeCreateEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeCreateEntityImplCopyWith<_$RecipeCreateEntityImpl> get copyWith =>
|
||||
__$$RecipeCreateEntityImplCopyWithImpl<_$RecipeCreateEntityImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _RecipeCreateEntity extends RecipeCreateEntity {
|
||||
const factory _RecipeCreateEntity(
|
||||
{final String? title,
|
||||
final TypeOfRecipe? typeOfRecipe,
|
||||
final int? countOfPortions,
|
||||
final double? energyInOnePortion,
|
||||
final int? totalCookHours,
|
||||
final int? totalCookMinutes,
|
||||
final int? activeCookHours,
|
||||
final int? activeCookMinutes,
|
||||
final String? description,
|
||||
final File? image,
|
||||
final String? videoUrl,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final List<StepEntity> steps,
|
||||
required final List<String> tags}) = _$RecipeCreateEntityImpl;
|
||||
const _RecipeCreateEntity._() : super._();
|
||||
|
||||
@override
|
||||
String? get title;
|
||||
@override
|
||||
TypeOfRecipe? get typeOfRecipe;
|
||||
@override
|
||||
int? get countOfPortions;
|
||||
@override
|
||||
double? get energyInOnePortion;
|
||||
@override
|
||||
int? get totalCookHours;
|
||||
@override
|
||||
int? get totalCookMinutes;
|
||||
@override
|
||||
int? get activeCookHours;
|
||||
@override
|
||||
int? get activeCookMinutes;
|
||||
@override
|
||||
String? get description;
|
||||
@override
|
||||
File? get image;
|
||||
@override
|
||||
String? get videoUrl;
|
||||
@override
|
||||
List<Ingredient> get ingredients;
|
||||
@override
|
||||
List<StepEntity> get steps;
|
||||
@override
|
||||
List<String> get tags;
|
||||
|
||||
/// Create a copy of RecipeCreateEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeCreateEntityImplCopyWith<_$RecipeCreateEntityImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StepEntity {
|
||||
String? get description => throw _privateConstructorUsedError;
|
||||
File? get image => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of StepEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$StepEntityCopyWith<StepEntity> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $StepEntityCopyWith<$Res> {
|
||||
factory $StepEntityCopyWith(
|
||||
StepEntity value, $Res Function(StepEntity) then) =
|
||||
_$StepEntityCopyWithImpl<$Res, StepEntity>;
|
||||
@useResult
|
||||
$Res call({String? description, File? image});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$StepEntityCopyWithImpl<$Res, $Val extends StepEntity>
|
||||
implements $StepEntityCopyWith<$Res> {
|
||||
_$StepEntityCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of StepEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? description = freezed,
|
||||
Object? image = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as File?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$StepEntityImplCopyWith<$Res>
|
||||
implements $StepEntityCopyWith<$Res> {
|
||||
factory _$$StepEntityImplCopyWith(
|
||||
_$StepEntityImpl value, $Res Function(_$StepEntityImpl) then) =
|
||||
__$$StepEntityImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? description, File? image});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$StepEntityImplCopyWithImpl<$Res>
|
||||
extends _$StepEntityCopyWithImpl<$Res, _$StepEntityImpl>
|
||||
implements _$$StepEntityImplCopyWith<$Res> {
|
||||
__$$StepEntityImplCopyWithImpl(
|
||||
_$StepEntityImpl _value, $Res Function(_$StepEntityImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of StepEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? description = freezed,
|
||||
Object? image = freezed,
|
||||
}) {
|
||||
return _then(_$StepEntityImpl(
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as File?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$StepEntityImpl extends _StepEntity {
|
||||
const _$StepEntityImpl({this.description, this.image}) : super._();
|
||||
|
||||
@override
|
||||
final String? description;
|
||||
@override
|
||||
final File? image;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StepEntity(description: $description, image: $image)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$StepEntityImpl &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.image, image) || other.image == image));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, description, image);
|
||||
|
||||
/// Create a copy of StepEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$StepEntityImplCopyWith<_$StepEntityImpl> get copyWith =>
|
||||
__$$StepEntityImplCopyWithImpl<_$StepEntityImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _StepEntity extends StepEntity {
|
||||
const factory _StepEntity({final String? description, final File? image}) =
|
||||
_$StepEntityImpl;
|
||||
const _StepEntity._() : super._();
|
||||
|
||||
@override
|
||||
String? get description;
|
||||
@override
|
||||
File? get image;
|
||||
|
||||
/// Create a copy of StepEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$StepEntityImplCopyWith<_$StepEntityImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'ingredient.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
|
||||
return _Ingredient.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Ingredient {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get unit => throw _privateConstructorUsedError;
|
||||
String get portion => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Ingredient to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Ingredient
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$IngredientCopyWith<Ingredient> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $IngredientCopyWith<$Res> {
|
||||
factory $IngredientCopyWith(
|
||||
Ingredient value, $Res Function(Ingredient) then) =
|
||||
_$IngredientCopyWithImpl<$Res, Ingredient>;
|
||||
@useResult
|
||||
$Res call({String name, String unit, String portion});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient>
|
||||
implements $IngredientCopyWith<$Res> {
|
||||
_$IngredientCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Ingredient
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? unit = null,
|
||||
Object? portion = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
unit: null == unit
|
||||
? _value.unit
|
||||
: unit // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
portion: null == portion
|
||||
? _value.portion
|
||||
: portion // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$IngredientImplCopyWith<$Res>
|
||||
implements $IngredientCopyWith<$Res> {
|
||||
factory _$$IngredientImplCopyWith(
|
||||
_$IngredientImpl value, $Res Function(_$IngredientImpl) then) =
|
||||
__$$IngredientImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String name, String unit, String portion});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$IngredientImplCopyWithImpl<$Res>
|
||||
extends _$IngredientCopyWithImpl<$Res, _$IngredientImpl>
|
||||
implements _$$IngredientImplCopyWith<$Res> {
|
||||
__$$IngredientImplCopyWithImpl(
|
||||
_$IngredientImpl _value, $Res Function(_$IngredientImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Ingredient
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? unit = null,
|
||||
Object? portion = null,
|
||||
}) {
|
||||
return _then(_$IngredientImpl(
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
unit: null == unit
|
||||
? _value.unit
|
||||
: unit // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
portion: null == portion
|
||||
? _value.portion
|
||||
: portion // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$IngredientImpl implements _Ingredient {
|
||||
const _$IngredientImpl(
|
||||
{required this.name, required this.unit, required this.portion});
|
||||
|
||||
factory _$IngredientImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IngredientImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String unit;
|
||||
@override
|
||||
final String portion;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Ingredient(name: $name, unit: $unit, portion: $portion)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$IngredientImpl &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.unit, unit) || other.unit == unit) &&
|
||||
(identical(other.portion, portion) || other.portion == portion));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, name, unit, portion);
|
||||
|
||||
/// Create a copy of Ingredient
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
|
||||
__$$IngredientImplCopyWithImpl<_$IngredientImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$IngredientImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Ingredient implements Ingredient {
|
||||
const factory _Ingredient(
|
||||
{required final String name,
|
||||
required final String unit,
|
||||
required final String portion}) = _$IngredientImpl;
|
||||
|
||||
factory _Ingredient.fromJson(Map<String, dynamic> json) =
|
||||
_$IngredientImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get unit;
|
||||
@override
|
||||
String get portion;
|
||||
|
||||
/// Create a copy of Ingredient
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$IngredientImplCopyWith<_$IngredientImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'ingredient.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$IngredientImpl _$$IngredientImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IngredientImpl(
|
||||
name: json['name'] as String,
|
||||
unit: json['unit'] as String,
|
||||
portion: json['portion'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$IngredientImplToJson(_$IngredientImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'unit': instance.unit,
|
||||
'portion': instance.portion,
|
||||
};
|
||||
@@ -1,177 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'product.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
Product _$ProductFromJson(Map<String, dynamic> json) {
|
||||
return _Product.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Product {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Product to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Product
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ProductCopyWith<Product> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProductCopyWith<$Res> {
|
||||
factory $ProductCopyWith(Product value, $Res Function(Product) then) =
|
||||
_$ProductCopyWithImpl<$Res, Product>;
|
||||
@useResult
|
||||
$Res call({int id, String name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProductCopyWithImpl<$Res, $Val extends Product>
|
||||
implements $ProductCopyWith<$Res> {
|
||||
_$ProductCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Product
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProductImplCopyWith<$Res> implements $ProductCopyWith<$Res> {
|
||||
factory _$$ProductImplCopyWith(
|
||||
_$ProductImpl value, $Res Function(_$ProductImpl) then) =
|
||||
__$$ProductImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id, String name});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProductImplCopyWithImpl<$Res>
|
||||
extends _$ProductCopyWithImpl<$Res, _$ProductImpl>
|
||||
implements _$$ProductImplCopyWith<$Res> {
|
||||
__$$ProductImplCopyWithImpl(
|
||||
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Product
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
}) {
|
||||
return _then(_$ProductImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ProductImpl implements _Product {
|
||||
const _$ProductImpl({required this.id, required this.name});
|
||||
|
||||
factory _$ProductImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ProductImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String name;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Product(id: $id, name: $name)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProductImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, name);
|
||||
|
||||
/// Create a copy of Product
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
|
||||
__$$ProductImplCopyWithImpl<_$ProductImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ProductImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Product implements Product {
|
||||
const factory _Product({required final int id, required final String name}) =
|
||||
_$ProductImpl;
|
||||
|
||||
factory _Product.fromJson(Map<String, dynamic> json) = _$ProductImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get name;
|
||||
|
||||
/// Create a copy of Product
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'product.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ProductImpl _$$ProductImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ProductImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProductImplToJson(_$ProductImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
};
|
||||
@@ -1,445 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'recipe_create_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
RecipeCreateModel _$RecipeCreateModelFromJson(Map<String, dynamic> json) {
|
||||
return _RecipeCreateModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RecipeCreateModel {
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
RecipeType get type => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'video_url')
|
||||
String? get videoUrl => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'cooking_time')
|
||||
String? get cookingTime => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'active_time')
|
||||
String? get activeTime => throw _privateConstructorUsedError;
|
||||
String get servings => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
String get energyPerServing => throw _privateConstructorUsedError;
|
||||
List<String> get tags => throw _privateConstructorUsedError;
|
||||
List<Ingredient> get ingredients => throw _privateConstructorUsedError;
|
||||
List<Step> get steps => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RecipeCreateModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RecipeCreateModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RecipeCreateModelCopyWith<RecipeCreateModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipeCreateModelCopyWith<$Res> {
|
||||
factory $RecipeCreateModelCopyWith(
|
||||
RecipeCreateModel value, $Res Function(RecipeCreateModel) then) =
|
||||
_$RecipeCreateModelCopyWithImpl<$Res, RecipeCreateModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String title,
|
||||
String state,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
RecipeType type,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||
@JsonKey(name: 'active_time') String? activeTime,
|
||||
String servings,
|
||||
@JsonKey(name: 'energy_per_serving') String energyPerServing,
|
||||
List<String> tags,
|
||||
List<Ingredient> ingredients,
|
||||
List<Step> steps});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipeCreateModelCopyWithImpl<$Res, $Val extends RecipeCreateModel>
|
||||
implements $RecipeCreateModelCopyWith<$Res> {
|
||||
_$RecipeCreateModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RecipeCreateModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = null,
|
||||
Object? state = null,
|
||||
Object? description = null,
|
||||
Object? type = null,
|
||||
Object? videoUrl = freezed,
|
||||
Object? cookingTime = freezed,
|
||||
Object? activeTime = freezed,
|
||||
Object? servings = null,
|
||||
Object? energyPerServing = null,
|
||||
Object? tags = null,
|
||||
Object? ingredients = null,
|
||||
Object? steps = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as RecipeType,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
cookingTime: freezed == cookingTime
|
||||
? _value.cookingTime
|
||||
: cookingTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
activeTime: freezed == activeTime
|
||||
? _value.activeTime
|
||||
: activeTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
servings: null == servings
|
||||
? _value.servings
|
||||
: servings // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
energyPerServing: null == energyPerServing
|
||||
? _value.energyPerServing
|
||||
: energyPerServing // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
tags: null == tags
|
||||
? _value.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
ingredients: null == ingredients
|
||||
? _value.ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient>,
|
||||
steps: null == steps
|
||||
? _value.steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<Step>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeCreateModelImplCopyWith<$Res>
|
||||
implements $RecipeCreateModelCopyWith<$Res> {
|
||||
factory _$$RecipeCreateModelImplCopyWith(_$RecipeCreateModelImpl value,
|
||||
$Res Function(_$RecipeCreateModelImpl) then) =
|
||||
__$$RecipeCreateModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String title,
|
||||
String state,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
RecipeType type,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||
@JsonKey(name: 'active_time') String? activeTime,
|
||||
String servings,
|
||||
@JsonKey(name: 'energy_per_serving') String energyPerServing,
|
||||
List<String> tags,
|
||||
List<Ingredient> ingredients,
|
||||
List<Step> steps});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeCreateModelImplCopyWithImpl<$Res>
|
||||
extends _$RecipeCreateModelCopyWithImpl<$Res, _$RecipeCreateModelImpl>
|
||||
implements _$$RecipeCreateModelImplCopyWith<$Res> {
|
||||
__$$RecipeCreateModelImplCopyWithImpl(_$RecipeCreateModelImpl _value,
|
||||
$Res Function(_$RecipeCreateModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RecipeCreateModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? title = null,
|
||||
Object? state = null,
|
||||
Object? description = null,
|
||||
Object? type = null,
|
||||
Object? videoUrl = freezed,
|
||||
Object? cookingTime = freezed,
|
||||
Object? activeTime = freezed,
|
||||
Object? servings = null,
|
||||
Object? energyPerServing = null,
|
||||
Object? tags = null,
|
||||
Object? ingredients = null,
|
||||
Object? steps = null,
|
||||
}) {
|
||||
return _then(_$RecipeCreateModelImpl(
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
type: null == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as RecipeType,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
cookingTime: freezed == cookingTime
|
||||
? _value.cookingTime
|
||||
: cookingTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
activeTime: freezed == activeTime
|
||||
? _value.activeTime
|
||||
: activeTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
servings: null == servings
|
||||
? _value.servings
|
||||
: servings // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
energyPerServing: null == energyPerServing
|
||||
? _value.energyPerServing
|
||||
: energyPerServing // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
tags: null == tags
|
||||
? _value._tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
ingredients: null == ingredients
|
||||
? _value._ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient>,
|
||||
steps: null == steps
|
||||
? _value._steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<Step>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$RecipeCreateModelImpl implements _RecipeCreateModel {
|
||||
const _$RecipeCreateModelImpl(
|
||||
{required this.title,
|
||||
required this.state,
|
||||
@JsonKey(name: 'description_md') required this.description,
|
||||
required this.type,
|
||||
@JsonKey(name: 'video_url') this.videoUrl,
|
||||
@JsonKey(name: 'cooking_time') this.cookingTime,
|
||||
@JsonKey(name: 'active_time') this.activeTime,
|
||||
required this.servings,
|
||||
@JsonKey(name: 'energy_per_serving') required this.energyPerServing,
|
||||
required final List<String> tags,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final List<Step> steps})
|
||||
: _tags = tags,
|
||||
_ingredients = ingredients,
|
||||
_steps = steps;
|
||||
|
||||
factory _$RecipeCreateModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipeCreateModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
final String state;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
final String description;
|
||||
@override
|
||||
final RecipeType type;
|
||||
@override
|
||||
@JsonKey(name: 'video_url')
|
||||
final String? videoUrl;
|
||||
@override
|
||||
@JsonKey(name: 'cooking_time')
|
||||
final String? cookingTime;
|
||||
@override
|
||||
@JsonKey(name: 'active_time')
|
||||
final String? activeTime;
|
||||
@override
|
||||
final String servings;
|
||||
@override
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
final String energyPerServing;
|
||||
final List<String> _tags;
|
||||
@override
|
||||
List<String> get tags {
|
||||
if (_tags is EqualUnmodifiableListView) return _tags;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_tags);
|
||||
}
|
||||
|
||||
final List<Ingredient> _ingredients;
|
||||
@override
|
||||
List<Ingredient> get ingredients {
|
||||
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_ingredients);
|
||||
}
|
||||
|
||||
final List<Step> _steps;
|
||||
@override
|
||||
List<Step> get steps {
|
||||
if (_steps is EqualUnmodifiableListView) return _steps;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_steps);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RecipeCreateModel(title: $title, state: $state, description: $description, type: $type, videoUrl: $videoUrl, cookingTime: $cookingTime, activeTime: $activeTime, servings: $servings, energyPerServing: $energyPerServing, tags: $tags, ingredients: $ingredients, steps: $steps)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeCreateModelImpl &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.type, type) || other.type == type) &&
|
||||
(identical(other.videoUrl, videoUrl) ||
|
||||
other.videoUrl == videoUrl) &&
|
||||
(identical(other.cookingTime, cookingTime) ||
|
||||
other.cookingTime == cookingTime) &&
|
||||
(identical(other.activeTime, activeTime) ||
|
||||
other.activeTime == activeTime) &&
|
||||
(identical(other.servings, servings) ||
|
||||
other.servings == servings) &&
|
||||
(identical(other.energyPerServing, energyPerServing) ||
|
||||
other.energyPerServing == energyPerServing) &&
|
||||
const DeepCollectionEquality().equals(other._tags, _tags) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._ingredients, _ingredients) &&
|
||||
const DeepCollectionEquality().equals(other._steps, _steps));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
title,
|
||||
state,
|
||||
description,
|
||||
type,
|
||||
videoUrl,
|
||||
cookingTime,
|
||||
activeTime,
|
||||
servings,
|
||||
energyPerServing,
|
||||
const DeepCollectionEquality().hash(_tags),
|
||||
const DeepCollectionEquality().hash(_ingredients),
|
||||
const DeepCollectionEquality().hash(_steps));
|
||||
|
||||
/// Create a copy of RecipeCreateModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeCreateModelImplCopyWith<_$RecipeCreateModelImpl> get copyWith =>
|
||||
__$$RecipeCreateModelImplCopyWithImpl<_$RecipeCreateModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$RecipeCreateModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _RecipeCreateModel implements RecipeCreateModel {
|
||||
const factory _RecipeCreateModel(
|
||||
{required final String title,
|
||||
required final String state,
|
||||
@JsonKey(name: 'description_md') required final String description,
|
||||
required final RecipeType type,
|
||||
@JsonKey(name: 'video_url') final String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') final String? cookingTime,
|
||||
@JsonKey(name: 'active_time') final String? activeTime,
|
||||
required final String servings,
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
required final String energyPerServing,
|
||||
required final List<String> tags,
|
||||
required final List<Ingredient> ingredients,
|
||||
required final List<Step> steps}) = _$RecipeCreateModelImpl;
|
||||
|
||||
factory _RecipeCreateModel.fromJson(Map<String, dynamic> json) =
|
||||
_$RecipeCreateModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
String get state;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description;
|
||||
@override
|
||||
RecipeType get type;
|
||||
@override
|
||||
@JsonKey(name: 'video_url')
|
||||
String? get videoUrl;
|
||||
@override
|
||||
@JsonKey(name: 'cooking_time')
|
||||
String? get cookingTime;
|
||||
@override
|
||||
@JsonKey(name: 'active_time')
|
||||
String? get activeTime;
|
||||
@override
|
||||
String get servings;
|
||||
@override
|
||||
@JsonKey(name: 'energy_per_serving')
|
||||
String get energyPerServing;
|
||||
@override
|
||||
List<String> get tags;
|
||||
@override
|
||||
List<Ingredient> get ingredients;
|
||||
@override
|
||||
List<Step> get steps;
|
||||
|
||||
/// Create a copy of RecipeCreateModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeCreateModelImplCopyWith<_$RecipeCreateModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recipe_create_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipeCreateModelImpl _$$RecipeCreateModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$RecipeCreateModelImpl(
|
||||
title: json['title'] as String,
|
||||
state: json['state'] as String,
|
||||
description: json['description_md'] as String,
|
||||
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
|
||||
videoUrl: json['video_url'] as String?,
|
||||
cookingTime: json['cooking_time'] as String?,
|
||||
activeTime: json['active_time'] as String?,
|
||||
servings: json['servings'] as String,
|
||||
energyPerServing: json['energy_per_serving'] as String,
|
||||
tags: (json['tags'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
ingredients: (json['ingredients'] as List<dynamic>)
|
||||
.map((e) => Ingredient.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
steps: (json['steps'] as List<dynamic>)
|
||||
.map((e) => Step.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipeCreateModelImplToJson(
|
||||
_$RecipeCreateModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'title': instance.title,
|
||||
'state': instance.state,
|
||||
'description_md': instance.description,
|
||||
'type': _$RecipeTypeEnumMap[instance.type]!,
|
||||
'video_url': instance.videoUrl,
|
||||
'cooking_time': instance.cookingTime,
|
||||
'active_time': instance.activeTime,
|
||||
'servings': instance.servings,
|
||||
'energy_per_serving': instance.energyPerServing,
|
||||
'tags': instance.tags,
|
||||
'ingredients': instance.ingredients,
|
||||
'steps': instance.steps,
|
||||
};
|
||||
|
||||
const _$RecipeTypeEnumMap = {
|
||||
RecipeType.firstMeals: 'firstMeals',
|
||||
RecipeType.secondMeals: 'secondMeals',
|
||||
RecipeType.salads: 'salads',
|
||||
RecipeType.snacks: 'snacks',
|
||||
RecipeType.sweets: 'sweets',
|
||||
RecipeType.drinks: 'drinks',
|
||||
RecipeType.other: 'other',
|
||||
};
|
||||
@@ -1,459 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'recipe_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
RecipeModel _$RecipeModelFromJson(Map<String, dynamic> json) {
|
||||
return _RecipeModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RecipeModel {
|
||||
List<Ingredient?>? get ingredients => throw _privateConstructorUsedError;
|
||||
List<Step?>? get steps => throw _privateConstructorUsedError;
|
||||
List<String>? get tags => throw _privateConstructorUsedError;
|
||||
String? get type => throw _privateConstructorUsedError;
|
||||
String? get state => throw _privateConstructorUsedError;
|
||||
String? get title => throw _privateConstructorUsedError;
|
||||
String? get description => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'video_url')
|
||||
String? get videoUrl => throw _privateConstructorUsedError;
|
||||
String? get image => throw _privateConstructorUsedError;
|
||||
int? get totalCookingTime => throw _privateConstructorUsedError;
|
||||
int? get activeCookTime => throw _privateConstructorUsedError;
|
||||
int? get servings => throw _privateConstructorUsedError;
|
||||
int? get energyPerServing => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RecipeModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RecipeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RecipeModelCopyWith<RecipeModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipeModelCopyWith<$Res> {
|
||||
factory $RecipeModelCopyWith(
|
||||
RecipeModel value, $Res Function(RecipeModel) then) =
|
||||
_$RecipeModelCopyWithImpl<$Res, RecipeModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{List<Ingredient?>? ingredients,
|
||||
List<Step?>? steps,
|
||||
List<String>? tags,
|
||||
String? type,
|
||||
String? state,
|
||||
String? title,
|
||||
String? description,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
String? image,
|
||||
int? totalCookingTime,
|
||||
int? activeCookTime,
|
||||
int? servings,
|
||||
int? energyPerServing});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel>
|
||||
implements $RecipeModelCopyWith<$Res> {
|
||||
_$RecipeModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RecipeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? ingredients = freezed,
|
||||
Object? steps = freezed,
|
||||
Object? tags = freezed,
|
||||
Object? type = freezed,
|
||||
Object? state = freezed,
|
||||
Object? title = freezed,
|
||||
Object? description = freezed,
|
||||
Object? videoUrl = freezed,
|
||||
Object? image = freezed,
|
||||
Object? totalCookingTime = freezed,
|
||||
Object? activeCookTime = freezed,
|
||||
Object? servings = freezed,
|
||||
Object? energyPerServing = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
ingredients: freezed == ingredients
|
||||
? _value.ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient?>?,
|
||||
steps: freezed == steps
|
||||
? _value.steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<Step?>?,
|
||||
tags: freezed == tags
|
||||
? _value.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
type: freezed == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
title: freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
totalCookingTime: freezed == totalCookingTime
|
||||
? _value.totalCookingTime
|
||||
: totalCookingTime // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookTime: freezed == activeCookTime
|
||||
? _value.activeCookTime
|
||||
: activeCookTime // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
servings: freezed == servings
|
||||
? _value.servings
|
||||
: servings // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
energyPerServing: freezed == energyPerServing
|
||||
? _value.energyPerServing
|
||||
: energyPerServing // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeModelImplCopyWith<$Res>
|
||||
implements $RecipeModelCopyWith<$Res> {
|
||||
factory _$$RecipeModelImplCopyWith(
|
||||
_$RecipeModelImpl value, $Res Function(_$RecipeModelImpl) then) =
|
||||
__$$RecipeModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{List<Ingredient?>? ingredients,
|
||||
List<Step?>? steps,
|
||||
List<String>? tags,
|
||||
String? type,
|
||||
String? state,
|
||||
String? title,
|
||||
String? description,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
String? image,
|
||||
int? totalCookingTime,
|
||||
int? activeCookTime,
|
||||
int? servings,
|
||||
int? energyPerServing});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeModelImplCopyWithImpl<$Res>
|
||||
extends _$RecipeModelCopyWithImpl<$Res, _$RecipeModelImpl>
|
||||
implements _$$RecipeModelImplCopyWith<$Res> {
|
||||
__$$RecipeModelImplCopyWithImpl(
|
||||
_$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RecipeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? ingredients = freezed,
|
||||
Object? steps = freezed,
|
||||
Object? tags = freezed,
|
||||
Object? type = freezed,
|
||||
Object? state = freezed,
|
||||
Object? title = freezed,
|
||||
Object? description = freezed,
|
||||
Object? videoUrl = freezed,
|
||||
Object? image = freezed,
|
||||
Object? totalCookingTime = freezed,
|
||||
Object? activeCookTime = freezed,
|
||||
Object? servings = freezed,
|
||||
Object? energyPerServing = freezed,
|
||||
}) {
|
||||
return _then(_$RecipeModelImpl(
|
||||
ingredients: freezed == ingredients
|
||||
? _value._ingredients
|
||||
: ingredients // ignore: cast_nullable_to_non_nullable
|
||||
as List<Ingredient?>?,
|
||||
steps: freezed == steps
|
||||
? _value._steps
|
||||
: steps // ignore: cast_nullable_to_non_nullable
|
||||
as List<Step?>?,
|
||||
tags: freezed == tags
|
||||
? _value._tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
type: freezed == type
|
||||
? _value.type
|
||||
: type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
state: freezed == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
title: freezed == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
videoUrl: freezed == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
totalCookingTime: freezed == totalCookingTime
|
||||
? _value.totalCookingTime
|
||||
: totalCookingTime // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
activeCookTime: freezed == activeCookTime
|
||||
? _value.activeCookTime
|
||||
: activeCookTime // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
servings: freezed == servings
|
||||
? _value.servings
|
||||
: servings // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
energyPerServing: freezed == energyPerServing
|
||||
? _value.energyPerServing
|
||||
: energyPerServing // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$RecipeModelImpl implements _RecipeModel {
|
||||
const _$RecipeModelImpl(
|
||||
{final List<Ingredient?>? ingredients,
|
||||
final List<Step?>? steps,
|
||||
final List<String>? tags,
|
||||
this.type,
|
||||
this.state,
|
||||
this.title,
|
||||
this.description,
|
||||
@JsonKey(name: 'video_url') this.videoUrl,
|
||||
this.image,
|
||||
this.totalCookingTime,
|
||||
this.activeCookTime,
|
||||
this.servings,
|
||||
this.energyPerServing})
|
||||
: _ingredients = ingredients,
|
||||
_steps = steps,
|
||||
_tags = tags;
|
||||
|
||||
factory _$RecipeModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipeModelImplFromJson(json);
|
||||
|
||||
final List<Ingredient?>? _ingredients;
|
||||
@override
|
||||
List<Ingredient?>? get ingredients {
|
||||
final value = _ingredients;
|
||||
if (value == null) return null;
|
||||
if (_ingredients is EqualUnmodifiableListView) return _ingredients;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
final List<Step?>? _steps;
|
||||
@override
|
||||
List<Step?>? get steps {
|
||||
final value = _steps;
|
||||
if (value == null) return null;
|
||||
if (_steps is EqualUnmodifiableListView) return _steps;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
final List<String>? _tags;
|
||||
@override
|
||||
List<String>? get tags {
|
||||
final value = _tags;
|
||||
if (value == null) return null;
|
||||
if (_tags is EqualUnmodifiableListView) return _tags;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override
|
||||
final String? type;
|
||||
@override
|
||||
final String? state;
|
||||
@override
|
||||
final String? title;
|
||||
@override
|
||||
final String? description;
|
||||
@override
|
||||
@JsonKey(name: 'video_url')
|
||||
final String? videoUrl;
|
||||
@override
|
||||
final String? image;
|
||||
@override
|
||||
final int? totalCookingTime;
|
||||
@override
|
||||
final int? activeCookTime;
|
||||
@override
|
||||
final int? servings;
|
||||
@override
|
||||
final int? energyPerServing;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RecipeModel(ingredients: $ingredients, steps: $steps, tags: $tags, type: $type, state: $state, title: $title, description: $description, videoUrl: $videoUrl, image: $image, totalCookingTime: $totalCookingTime, activeCookTime: $activeCookTime, servings: $servings, energyPerServing: $energyPerServing)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeModelImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._ingredients, _ingredients) &&
|
||||
const DeepCollectionEquality().equals(other._steps, _steps) &&
|
||||
const DeepCollectionEquality().equals(other._tags, _tags) &&
|
||||
(identical(other.type, type) || other.type == type) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.videoUrl, videoUrl) ||
|
||||
other.videoUrl == videoUrl) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.totalCookingTime, totalCookingTime) ||
|
||||
other.totalCookingTime == totalCookingTime) &&
|
||||
(identical(other.activeCookTime, activeCookTime) ||
|
||||
other.activeCookTime == activeCookTime) &&
|
||||
(identical(other.servings, servings) ||
|
||||
other.servings == servings) &&
|
||||
(identical(other.energyPerServing, energyPerServing) ||
|
||||
other.energyPerServing == energyPerServing));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(_ingredients),
|
||||
const DeepCollectionEquality().hash(_steps),
|
||||
const DeepCollectionEquality().hash(_tags),
|
||||
type,
|
||||
state,
|
||||
title,
|
||||
description,
|
||||
videoUrl,
|
||||
image,
|
||||
totalCookingTime,
|
||||
activeCookTime,
|
||||
servings,
|
||||
energyPerServing);
|
||||
|
||||
/// Create a copy of RecipeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith =>
|
||||
__$$RecipeModelImplCopyWithImpl<_$RecipeModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$RecipeModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _RecipeModel implements RecipeModel {
|
||||
const factory _RecipeModel(
|
||||
{final List<Ingredient?>? ingredients,
|
||||
final List<Step?>? steps,
|
||||
final List<String>? tags,
|
||||
final String? type,
|
||||
final String? state,
|
||||
final String? title,
|
||||
final String? description,
|
||||
@JsonKey(name: 'video_url') final String? videoUrl,
|
||||
final String? image,
|
||||
final int? totalCookingTime,
|
||||
final int? activeCookTime,
|
||||
final int? servings,
|
||||
final int? energyPerServing}) = _$RecipeModelImpl;
|
||||
|
||||
factory _RecipeModel.fromJson(Map<String, dynamic> json) =
|
||||
_$RecipeModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<Ingredient?>? get ingredients;
|
||||
@override
|
||||
List<Step?>? get steps;
|
||||
@override
|
||||
List<String>? get tags;
|
||||
@override
|
||||
String? get type;
|
||||
@override
|
||||
String? get state;
|
||||
@override
|
||||
String? get title;
|
||||
@override
|
||||
String? get description;
|
||||
@override
|
||||
@JsonKey(name: 'video_url')
|
||||
String? get videoUrl;
|
||||
@override
|
||||
String? get image;
|
||||
@override
|
||||
int? get totalCookingTime;
|
||||
@override
|
||||
int? get activeCookTime;
|
||||
@override
|
||||
int? get servings;
|
||||
@override
|
||||
int? get energyPerServing;
|
||||
|
||||
/// Create a copy of RecipeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recipe_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipeModelImpl _$$RecipeModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RecipeModelImpl(
|
||||
ingredients: (json['ingredients'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
e == null ? null : Ingredient.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
steps: (json['steps'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
e == null ? null : Step.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
tags: (json['tags'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
type: json['type'] as String?,
|
||||
state: json['state'] as String?,
|
||||
title: json['title'] as String?,
|
||||
description: json['description'] as String?,
|
||||
videoUrl: json['video_url'] as String?,
|
||||
image: json['image'] as String?,
|
||||
totalCookingTime: (json['totalCookingTime'] as num?)?.toInt(),
|
||||
activeCookTime: (json['activeCookTime'] as num?)?.toInt(),
|
||||
servings: (json['servings'] as num?)?.toInt(),
|
||||
energyPerServing: (json['energyPerServing'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipeModelImplToJson(_$RecipeModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'ingredients': instance.ingredients,
|
||||
'steps': instance.steps,
|
||||
'tags': instance.tags,
|
||||
'type': instance.type,
|
||||
'state': instance.state,
|
||||
'title': instance.title,
|
||||
'description': instance.description,
|
||||
'video_url': instance.videoUrl,
|
||||
'image': instance.image,
|
||||
'totalCookingTime': instance.totalCookingTime,
|
||||
'activeCookTime': instance.activeCookTime,
|
||||
'servings': instance.servings,
|
||||
'energyPerServing': instance.energyPerServing,
|
||||
};
|
||||
@@ -1,506 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'recipe_tag_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
RecipeTagModel _$RecipeTagModelFromJson(Map<String, dynamic> json) {
|
||||
return _RecipeTagModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RecipeTagModel {
|
||||
@JsonKey(name: "data")
|
||||
List<RecipeTag> get data => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "links")
|
||||
Links get links => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "meta")
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RecipeTagModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RecipeTagModelCopyWith<RecipeTagModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipeTagModelCopyWith<$Res> {
|
||||
factory $RecipeTagModelCopyWith(
|
||||
RecipeTagModel value, $Res Function(RecipeTagModel) then) =
|
||||
_$RecipeTagModelCopyWithImpl<$Res, RecipeTagModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "data") List<RecipeTag> data,
|
||||
@JsonKey(name: "links") Links links,
|
||||
@JsonKey(name: "meta") Meta meta});
|
||||
|
||||
$LinksCopyWith<$Res> get links;
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipeTagModelCopyWithImpl<$Res, $Val extends RecipeTagModel>
|
||||
implements $RecipeTagModelCopyWith<$Res> {
|
||||
_$RecipeTagModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
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<RecipeTag>,
|
||||
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 RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LinksCopyWith<$Res> get links {
|
||||
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||
return _then(_value.copyWith(links: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$RecipeTagModelImplCopyWith<$Res>
|
||||
implements $RecipeTagModelCopyWith<$Res> {
|
||||
factory _$$RecipeTagModelImplCopyWith(_$RecipeTagModelImpl value,
|
||||
$Res Function(_$RecipeTagModelImpl) then) =
|
||||
__$$RecipeTagModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "data") List<RecipeTag> data,
|
||||
@JsonKey(name: "links") Links links,
|
||||
@JsonKey(name: "meta") Meta meta});
|
||||
|
||||
@override
|
||||
$LinksCopyWith<$Res> get links;
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeTagModelImplCopyWithImpl<$Res>
|
||||
extends _$RecipeTagModelCopyWithImpl<$Res, _$RecipeTagModelImpl>
|
||||
implements _$$RecipeTagModelImplCopyWith<$Res> {
|
||||
__$$RecipeTagModelImplCopyWithImpl(
|
||||
_$RecipeTagModelImpl _value, $Res Function(_$RecipeTagModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? data = null,
|
||||
Object? links = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$RecipeTagModelImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<RecipeTag>,
|
||||
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 _$RecipeTagModelImpl implements _RecipeTagModel {
|
||||
const _$RecipeTagModelImpl(
|
||||
{@JsonKey(name: "data") required final List<RecipeTag> data,
|
||||
@JsonKey(name: "links") required this.links,
|
||||
@JsonKey(name: "meta") required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$RecipeTagModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipeTagModelImplFromJson(json);
|
||||
|
||||
final List<RecipeTag> _data;
|
||||
@override
|
||||
@JsonKey(name: "data")
|
||||
List<RecipeTag> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
final Links links;
|
||||
@override
|
||||
@JsonKey(name: "meta")
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RecipeTagModel(data: $data, links: $links, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeTagModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.links, links) || other.links == links) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith =>
|
||||
__$$RecipeTagModelImplCopyWithImpl<_$RecipeTagModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$RecipeTagModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _RecipeTagModel implements RecipeTagModel {
|
||||
const factory _RecipeTagModel(
|
||||
{@JsonKey(name: "data") required final List<RecipeTag> data,
|
||||
@JsonKey(name: "links") required final Links links,
|
||||
@JsonKey(name: "meta") required final Meta meta}) = _$RecipeTagModelImpl;
|
||||
|
||||
factory _RecipeTagModel.fromJson(Map<String, dynamic> json) =
|
||||
_$RecipeTagModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "data")
|
||||
List<RecipeTag> get data;
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
Links get links;
|
||||
@override
|
||||
@JsonKey(name: "meta")
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of RecipeTagModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeTagModelImplCopyWith<_$RecipeTagModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
RecipeTag _$RecipeTagFromJson(Map<String, dynamic> json) {
|
||||
return _RecipeTag.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RecipeTag {
|
||||
@JsonKey(name: "id")
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "name")
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "recipes_count")
|
||||
int get recipesCount => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RecipeTag to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of RecipeTag
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$RecipeTagCopyWith<RecipeTag> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $RecipeTagCopyWith<$Res> {
|
||||
factory $RecipeTagCopyWith(RecipeTag value, $Res Function(RecipeTag) then) =
|
||||
_$RecipeTagCopyWithImpl<$Res, RecipeTag>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "name") String name,
|
||||
@JsonKey(name: "recipes_count") int recipesCount,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$RecipeTagCopyWithImpl<$Res, $Val extends RecipeTag>
|
||||
implements $RecipeTagCopyWith<$Res> {
|
||||
_$RecipeTagCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of RecipeTag
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? recipesCount = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
recipesCount: null == recipesCount
|
||||
? _value.recipesCount
|
||||
: recipesCount // 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 _$$RecipeTagImplCopyWith<$Res>
|
||||
implements $RecipeTagCopyWith<$Res> {
|
||||
factory _$$RecipeTagImplCopyWith(
|
||||
_$RecipeTagImpl value, $Res Function(_$RecipeTagImpl) then) =
|
||||
__$$RecipeTagImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "name") String name,
|
||||
@JsonKey(name: "recipes_count") int recipesCount,
|
||||
@JsonKey(name: "created_at") DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$RecipeTagImplCopyWithImpl<$Res>
|
||||
extends _$RecipeTagCopyWithImpl<$Res, _$RecipeTagImpl>
|
||||
implements _$$RecipeTagImplCopyWith<$Res> {
|
||||
__$$RecipeTagImplCopyWithImpl(
|
||||
_$RecipeTagImpl _value, $Res Function(_$RecipeTagImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of RecipeTag
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? recipesCount = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_$RecipeTagImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
recipesCount: null == recipesCount
|
||||
? _value.recipesCount
|
||||
: recipesCount // 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 _$RecipeTagImpl implements _RecipeTag {
|
||||
const _$RecipeTagImpl(
|
||||
{@JsonKey(name: "id") required this.id,
|
||||
@JsonKey(name: "name") required this.name,
|
||||
@JsonKey(name: "recipes_count") required this.recipesCount,
|
||||
@JsonKey(name: "created_at") required this.createdAt,
|
||||
@JsonKey(name: "updated_at") required this.updatedAt});
|
||||
|
||||
factory _$RecipeTagImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RecipeTagImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: "name")
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: "recipes_count")
|
||||
final int recipesCount;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
final DateTime updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RecipeTag(id: $id, name: $name, recipesCount: $recipesCount, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$RecipeTagImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.recipesCount, recipesCount) ||
|
||||
other.recipesCount == recipesCount) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, id, name, recipesCount, createdAt, updatedAt);
|
||||
|
||||
/// Create a copy of RecipeTag
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith =>
|
||||
__$$RecipeTagImplCopyWithImpl<_$RecipeTagImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$RecipeTagImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _RecipeTag implements RecipeTag {
|
||||
const factory _RecipeTag(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "name") required final String name,
|
||||
@JsonKey(name: "recipes_count") required final int recipesCount,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") required final DateTime updatedAt}) =
|
||||
_$RecipeTagImpl;
|
||||
|
||||
factory _RecipeTag.fromJson(Map<String, dynamic> json) =
|
||||
_$RecipeTagImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: "name")
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: "recipes_count")
|
||||
int get recipesCount;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at")
|
||||
DateTime get updatedAt;
|
||||
|
||||
/// Create a copy of RecipeTag
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$RecipeTagImplCopyWith<_$RecipeTagImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recipe_tag_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipeTagModelImpl _$$RecipeTagModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RecipeTagModelImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) => RecipeTag.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>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipeTagModelImplToJson(
|
||||
_$RecipeTagModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$RecipeTagImpl _$$RecipeTagImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RecipeTagImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
recipesCount: (json['recipes_count'] as num).toInt(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipeTagImplToJson(_$RecipeTagImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'recipes_count': instance.recipesCount,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
};
|
||||
@@ -1,177 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'step.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
Step _$StepFromJson(Map<String, dynamic> json) {
|
||||
return _Step.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Step {
|
||||
String? get image => throw _privateConstructorUsedError;
|
||||
String? get description => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Step to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Step
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$StepCopyWith<Step> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $StepCopyWith<$Res> {
|
||||
factory $StepCopyWith(Step value, $Res Function(Step) then) =
|
||||
_$StepCopyWithImpl<$Res, Step>;
|
||||
@useResult
|
||||
$Res call({String? image, String? description});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$StepCopyWithImpl<$Res, $Val extends Step>
|
||||
implements $StepCopyWith<$Res> {
|
||||
_$StepCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Step
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? image = freezed,
|
||||
Object? description = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> {
|
||||
factory _$$StepImplCopyWith(
|
||||
_$StepImpl value, $Res Function(_$StepImpl) then) =
|
||||
__$$StepImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String? image, String? description});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$StepImplCopyWithImpl<$Res>
|
||||
extends _$StepCopyWithImpl<$Res, _$StepImpl>
|
||||
implements _$$StepImplCopyWith<$Res> {
|
||||
__$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Step
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? image = freezed,
|
||||
Object? description = freezed,
|
||||
}) {
|
||||
return _then(_$StepImpl(
|
||||
image: freezed == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
description: freezed == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$StepImpl implements _Step {
|
||||
const _$StepImpl({this.image, this.description});
|
||||
|
||||
factory _$StepImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$StepImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String? image;
|
||||
@override
|
||||
final String? description;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Step(image: $image, description: $description)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$StepImpl &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, image, description);
|
||||
|
||||
/// Create a copy of Step
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
|
||||
__$$StepImplCopyWithImpl<_$StepImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$StepImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Step implements Step {
|
||||
const factory _Step({final String? image, final String? description}) =
|
||||
_$StepImpl;
|
||||
|
||||
factory _Step.fromJson(Map<String, dynamic> json) = _$StepImpl.fromJson;
|
||||
|
||||
@override
|
||||
String? get image;
|
||||
@override
|
||||
String? get description;
|
||||
|
||||
/// Create a copy of Step
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$StepImplCopyWith<_$StepImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'step.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
|
||||
image: json['image'] as String?,
|
||||
description: json['description'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'image': instance.image,
|
||||
'description': instance.description,
|
||||
};
|
||||
@@ -1,330 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'create_recipe_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateRecipeState {
|
||||
RecipeCreateEntity get entity => throw _privateConstructorUsedError;
|
||||
String? get titleValidationError => throw _privateConstructorUsedError;
|
||||
String? get descriptionValidationError => throw _privateConstructorUsedError;
|
||||
String? get cookingTimeValidationError => throw _privateConstructorUsedError;
|
||||
String? get activeTimeValidationError => throw _privateConstructorUsedError;
|
||||
String? get servingsValidationError => throw _privateConstructorUsedError;
|
||||
String? get energyPerServingValidationError =>
|
||||
throw _privateConstructorUsedError;
|
||||
String? get imageValidationError => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CreateRecipeStateCopyWith<CreateRecipeState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CreateRecipeStateCopyWith<$Res> {
|
||||
factory $CreateRecipeStateCopyWith(
|
||||
CreateRecipeState value, $Res Function(CreateRecipeState) then) =
|
||||
_$CreateRecipeStateCopyWithImpl<$Res, CreateRecipeState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{RecipeCreateEntity entity,
|
||||
String? titleValidationError,
|
||||
String? descriptionValidationError,
|
||||
String? cookingTimeValidationError,
|
||||
String? activeTimeValidationError,
|
||||
String? servingsValidationError,
|
||||
String? energyPerServingValidationError,
|
||||
String? imageValidationError});
|
||||
|
||||
$RecipeCreateEntityCopyWith<$Res> get entity;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CreateRecipeStateCopyWithImpl<$Res, $Val extends CreateRecipeState>
|
||||
implements $CreateRecipeStateCopyWith<$Res> {
|
||||
_$CreateRecipeStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? entity = null,
|
||||
Object? titleValidationError = freezed,
|
||||
Object? descriptionValidationError = freezed,
|
||||
Object? cookingTimeValidationError = freezed,
|
||||
Object? activeTimeValidationError = freezed,
|
||||
Object? servingsValidationError = freezed,
|
||||
Object? energyPerServingValidationError = freezed,
|
||||
Object? imageValidationError = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
entity: null == entity
|
||||
? _value.entity
|
||||
: entity // ignore: cast_nullable_to_non_nullable
|
||||
as RecipeCreateEntity,
|
||||
titleValidationError: freezed == titleValidationError
|
||||
? _value.titleValidationError
|
||||
: titleValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
descriptionValidationError: freezed == descriptionValidationError
|
||||
? _value.descriptionValidationError
|
||||
: descriptionValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
cookingTimeValidationError: freezed == cookingTimeValidationError
|
||||
? _value.cookingTimeValidationError
|
||||
: cookingTimeValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
activeTimeValidationError: freezed == activeTimeValidationError
|
||||
? _value.activeTimeValidationError
|
||||
: activeTimeValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
servingsValidationError: freezed == servingsValidationError
|
||||
? _value.servingsValidationError
|
||||
: servingsValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
energyPerServingValidationError: freezed ==
|
||||
energyPerServingValidationError
|
||||
? _value.energyPerServingValidationError
|
||||
: energyPerServingValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
imageValidationError: freezed == imageValidationError
|
||||
? _value.imageValidationError
|
||||
: imageValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$RecipeCreateEntityCopyWith<$Res> get entity {
|
||||
return $RecipeCreateEntityCopyWith<$Res>(_value.entity, (value) {
|
||||
return _then(_value.copyWith(entity: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CreateRecipeStateImplCopyWith<$Res>
|
||||
implements $CreateRecipeStateCopyWith<$Res> {
|
||||
factory _$$CreateRecipeStateImplCopyWith(_$CreateRecipeStateImpl value,
|
||||
$Res Function(_$CreateRecipeStateImpl) then) =
|
||||
__$$CreateRecipeStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{RecipeCreateEntity entity,
|
||||
String? titleValidationError,
|
||||
String? descriptionValidationError,
|
||||
String? cookingTimeValidationError,
|
||||
String? activeTimeValidationError,
|
||||
String? servingsValidationError,
|
||||
String? energyPerServingValidationError,
|
||||
String? imageValidationError});
|
||||
|
||||
@override
|
||||
$RecipeCreateEntityCopyWith<$Res> get entity;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CreateRecipeStateImplCopyWithImpl<$Res>
|
||||
extends _$CreateRecipeStateCopyWithImpl<$Res, _$CreateRecipeStateImpl>
|
||||
implements _$$CreateRecipeStateImplCopyWith<$Res> {
|
||||
__$$CreateRecipeStateImplCopyWithImpl(_$CreateRecipeStateImpl _value,
|
||||
$Res Function(_$CreateRecipeStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? entity = null,
|
||||
Object? titleValidationError = freezed,
|
||||
Object? descriptionValidationError = freezed,
|
||||
Object? cookingTimeValidationError = freezed,
|
||||
Object? activeTimeValidationError = freezed,
|
||||
Object? servingsValidationError = freezed,
|
||||
Object? energyPerServingValidationError = freezed,
|
||||
Object? imageValidationError = freezed,
|
||||
}) {
|
||||
return _then(_$CreateRecipeStateImpl(
|
||||
entity: null == entity
|
||||
? _value.entity
|
||||
: entity // ignore: cast_nullable_to_non_nullable
|
||||
as RecipeCreateEntity,
|
||||
titleValidationError: freezed == titleValidationError
|
||||
? _value.titleValidationError
|
||||
: titleValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
descriptionValidationError: freezed == descriptionValidationError
|
||||
? _value.descriptionValidationError
|
||||
: descriptionValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
cookingTimeValidationError: freezed == cookingTimeValidationError
|
||||
? _value.cookingTimeValidationError
|
||||
: cookingTimeValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
activeTimeValidationError: freezed == activeTimeValidationError
|
||||
? _value.activeTimeValidationError
|
||||
: activeTimeValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
servingsValidationError: freezed == servingsValidationError
|
||||
? _value.servingsValidationError
|
||||
: servingsValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
energyPerServingValidationError: freezed ==
|
||||
energyPerServingValidationError
|
||||
? _value.energyPerServingValidationError
|
||||
: energyPerServingValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
imageValidationError: freezed == imageValidationError
|
||||
? _value.imageValidationError
|
||||
: imageValidationError // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$CreateRecipeStateImpl implements _CreateRecipeState {
|
||||
const _$CreateRecipeStateImpl(
|
||||
{required this.entity,
|
||||
this.titleValidationError,
|
||||
this.descriptionValidationError,
|
||||
this.cookingTimeValidationError,
|
||||
this.activeTimeValidationError,
|
||||
this.servingsValidationError,
|
||||
this.energyPerServingValidationError,
|
||||
this.imageValidationError});
|
||||
|
||||
@override
|
||||
final RecipeCreateEntity entity;
|
||||
@override
|
||||
final String? titleValidationError;
|
||||
@override
|
||||
final String? descriptionValidationError;
|
||||
@override
|
||||
final String? cookingTimeValidationError;
|
||||
@override
|
||||
final String? activeTimeValidationError;
|
||||
@override
|
||||
final String? servingsValidationError;
|
||||
@override
|
||||
final String? energyPerServingValidationError;
|
||||
@override
|
||||
final String? imageValidationError;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateRecipeState(entity: $entity, titleValidationError: $titleValidationError, descriptionValidationError: $descriptionValidationError, cookingTimeValidationError: $cookingTimeValidationError, activeTimeValidationError: $activeTimeValidationError, servingsValidationError: $servingsValidationError, energyPerServingValidationError: $energyPerServingValidationError, imageValidationError: $imageValidationError)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CreateRecipeStateImpl &&
|
||||
(identical(other.entity, entity) || other.entity == entity) &&
|
||||
(identical(other.titleValidationError, titleValidationError) ||
|
||||
other.titleValidationError == titleValidationError) &&
|
||||
(identical(other.descriptionValidationError,
|
||||
descriptionValidationError) ||
|
||||
other.descriptionValidationError ==
|
||||
descriptionValidationError) &&
|
||||
(identical(other.cookingTimeValidationError,
|
||||
cookingTimeValidationError) ||
|
||||
other.cookingTimeValidationError ==
|
||||
cookingTimeValidationError) &&
|
||||
(identical(other.activeTimeValidationError,
|
||||
activeTimeValidationError) ||
|
||||
other.activeTimeValidationError == activeTimeValidationError) &&
|
||||
(identical(
|
||||
other.servingsValidationError, servingsValidationError) ||
|
||||
other.servingsValidationError == servingsValidationError) &&
|
||||
(identical(other.energyPerServingValidationError,
|
||||
energyPerServingValidationError) ||
|
||||
other.energyPerServingValidationError ==
|
||||
energyPerServingValidationError) &&
|
||||
(identical(other.imageValidationError, imageValidationError) ||
|
||||
other.imageValidationError == imageValidationError));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
entity,
|
||||
titleValidationError,
|
||||
descriptionValidationError,
|
||||
cookingTimeValidationError,
|
||||
activeTimeValidationError,
|
||||
servingsValidationError,
|
||||
energyPerServingValidationError,
|
||||
imageValidationError);
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CreateRecipeStateImplCopyWith<_$CreateRecipeStateImpl> get copyWith =>
|
||||
__$$CreateRecipeStateImplCopyWithImpl<_$CreateRecipeStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _CreateRecipeState implements CreateRecipeState {
|
||||
const factory _CreateRecipeState(
|
||||
{required final RecipeCreateEntity entity,
|
||||
final String? titleValidationError,
|
||||
final String? descriptionValidationError,
|
||||
final String? cookingTimeValidationError,
|
||||
final String? activeTimeValidationError,
|
||||
final String? servingsValidationError,
|
||||
final String? energyPerServingValidationError,
|
||||
final String? imageValidationError}) = _$CreateRecipeStateImpl;
|
||||
|
||||
@override
|
||||
RecipeCreateEntity get entity;
|
||||
@override
|
||||
String? get titleValidationError;
|
||||
@override
|
||||
String? get descriptionValidationError;
|
||||
@override
|
||||
String? get cookingTimeValidationError;
|
||||
@override
|
||||
String? get activeTimeValidationError;
|
||||
@override
|
||||
String? get servingsValidationError;
|
||||
@override
|
||||
String? get energyPerServingValidationError;
|
||||
@override
|
||||
String? get imageValidationError;
|
||||
|
||||
/// Create a copy of CreateRecipeState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CreateRecipeStateImplCopyWith<_$CreateRecipeStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,242 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recipe_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _CreateRecipeService implements CreateRecipeService {
|
||||
_CreateRecipeService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<void> likeRecipe({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/like',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addToFavorite({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/add_to_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> removeFromFavorite({required String slug}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/${slug}/remove_from_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<RecipeModel> getRecipe(String id) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<RecipeModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/show/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late RecipeModel _value;
|
||||
try {
|
||||
_value = RecipeModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, List<Product>>> getInputProduct(String name) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{r'name': name};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Map<String, List<Product>>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/product_nutritional_values/filter',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Map<String, List<Product>> _value;
|
||||
try {
|
||||
_value = _result.data!.map(
|
||||
(k, dynamic v) => MapEntry(
|
||||
k,
|
||||
(v as List)
|
||||
.map((i) => Product.fromJson(i as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> publishRecipe({required FormData formData}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = formData;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/create',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<RecipeModel> editRecipe(Map<String, Object?> recipe, String id) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData.fromMap(recipe);
|
||||
final _options = _setStreamType<RecipeModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/update/{id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late RecipeModel _value;
|
||||
try {
|
||||
_value = RecipeModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<RecipeTagModel> getTags() async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<RecipeTagModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/recipes/tags',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late RecipeTagModel _value;
|
||||
try {
|
||||
_value = RecipeTagModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,151 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DiaryDayWrapperModelImpl _$$DiaryDayWrapperModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DiaryDayWrapperModelImpl(
|
||||
diary: DiaryDayModel.fromJson(json['diary'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryDayWrapperModelImplToJson(
|
||||
_$DiaryDayWrapperModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'diary': instance.diary,
|
||||
};
|
||||
|
||||
_$DiaryDayModelImpl _$$DiaryDayModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DiaryDayModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
date: json['date'] as String,
|
||||
wakeup: json['wakeup'] as String?,
|
||||
retire: json['retire'] as String?,
|
||||
closed: (json['closed'] as num).toInt(),
|
||||
comment: json['comment'] as String,
|
||||
typeOfDiary:
|
||||
TypeOfDiaryModel.fromJson(json['state'] as Map<String, dynamic>),
|
||||
meals: (json['meals'] as List<dynamic>)
|
||||
.map((e) => MealModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryDayModelImplToJson(_$DiaryDayModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'date': instance.date,
|
||||
'wakeup': instance.wakeup,
|
||||
'retire': instance.retire,
|
||||
'closed': instance.closed,
|
||||
'comment': instance.comment,
|
||||
'state': instance.typeOfDiary,
|
||||
'meals': instance.meals,
|
||||
};
|
||||
|
||||
_$MealModelImpl _$$MealModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MealModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
time: json['time'] as String,
|
||||
typeNumber: (json['type_no'] as num).toInt(),
|
||||
satiety: (json['satiety'] as num).toInt(),
|
||||
mood: (json['mood'] as num).toInt(),
|
||||
portions: (json['portions'] as List<dynamic>)
|
||||
.map((e) => PortionModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
photos: (json['photos'] as List<dynamic>)
|
||||
.map((e) => DiaryPhotoModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MealModelImplToJson(_$MealModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'time': instance.time,
|
||||
'type_no': instance.typeNumber,
|
||||
'satiety': instance.satiety,
|
||||
'mood': instance.mood,
|
||||
'portions': instance.portions,
|
||||
'photos': instance.photos,
|
||||
};
|
||||
|
||||
_$DiaryPhotoModelImpl _$$DiaryPhotoModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DiaryPhotoModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
originalName: json['original_name'] as String,
|
||||
path: json['path'] as String,
|
||||
size: (json['size'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryPhotoModelImplToJson(
|
||||
_$DiaryPhotoModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'original_name': instance.originalName,
|
||||
'path': instance.path,
|
||||
'size': instance.size,
|
||||
};
|
||||
|
||||
_$PortionModelImpl _$$PortionModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$PortionModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
productNutritionalValueId:
|
||||
(json['product_nutritional_value_id'] as num?)?.toInt(),
|
||||
productName: json['product_name'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
portion: json['portion'] as String,
|
||||
fromDiet: json['from_diet'] as bool,
|
||||
portionState: $enumDecode(_$PortionStateEnumMap, json['state']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PortionModelImplToJson(_$PortionModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product_nutritional_value_id': instance.productNutritionalValueId,
|
||||
'product_name': instance.productName,
|
||||
'quantity': instance.quantity,
|
||||
'portion': instance.portion,
|
||||
'from_diet': instance.fromDiet,
|
||||
'state': _$PortionStateEnumMap[instance.portionState]!,
|
||||
};
|
||||
|
||||
const _$PortionStateEnumMap = {
|
||||
PortionState.filledDiet: 'filled_diet',
|
||||
PortionState.eatenFromDiet: 'eaten_from_diet',
|
||||
PortionState.eaten: 'eaten',
|
||||
PortionState.eatenDeleted: 'eaten_deleted',
|
||||
PortionState.eatenEdited: 'eaten_edited',
|
||||
PortionState.commented: 'commented',
|
||||
PortionState.reviewedByUser: 'reviewed_by_user',
|
||||
};
|
||||
|
||||
_$TypeOfDiaryModelImpl _$$TypeOfDiaryModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$TypeOfDiaryModelImpl(
|
||||
hasChosenDiet: json['has_chosen_diet'] as bool,
|
||||
hasChosenPlan: json['has_chosen_plan'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TypeOfDiaryModelImplToJson(
|
||||
_$TypeOfDiaryModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'has_chosen_diet': instance.hasChosenDiet,
|
||||
'has_chosen_plan': instance.hasChosenPlan,
|
||||
};
|
||||
|
||||
_$ProductInMealImpl _$$ProductInMealImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ProductInMealImpl(
|
||||
productName: json['product_name'] as String,
|
||||
portion: json['portion'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProductInMealImplToJson(_$ProductInMealImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'product_name': instance.productName,
|
||||
'portion': instance.portion,
|
||||
'quantity': instance.quantity,
|
||||
};
|
||||
@@ -1,166 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'diary_index_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
DiaryIndexModel _$DiaryIndexModelFromJson(Map<String, dynamic> json) {
|
||||
return _DiaryIndexModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DiaryIndexModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this DiaryIndexModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$DiaryIndexModelCopyWith<DiaryIndexModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DiaryIndexModelCopyWith<$Res> {
|
||||
factory $DiaryIndexModelCopyWith(
|
||||
DiaryIndexModel value, $Res Function(DiaryIndexModel) then) =
|
||||
_$DiaryIndexModelCopyWithImpl<$Res, DiaryIndexModel>;
|
||||
@useResult
|
||||
$Res call({int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DiaryIndexModelCopyWithImpl<$Res, $Val extends DiaryIndexModel>
|
||||
implements $DiaryIndexModelCopyWith<$Res> {
|
||||
_$DiaryIndexModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryIndexModelImplCopyWith<$Res>
|
||||
implements $DiaryIndexModelCopyWith<$Res> {
|
||||
factory _$$DiaryIndexModelImplCopyWith(_$DiaryIndexModelImpl value,
|
||||
$Res Function(_$DiaryIndexModelImpl) then) =
|
||||
__$$DiaryIndexModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryIndexModelImplCopyWithImpl<$Res>
|
||||
extends _$DiaryIndexModelCopyWithImpl<$Res, _$DiaryIndexModelImpl>
|
||||
implements _$$DiaryIndexModelImplCopyWith<$Res> {
|
||||
__$$DiaryIndexModelImplCopyWithImpl(
|
||||
_$DiaryIndexModelImpl _value, $Res Function(_$DiaryIndexModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
}) {
|
||||
return _then(_$DiaryIndexModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$DiaryIndexModelImpl implements _DiaryIndexModel {
|
||||
const _$DiaryIndexModelImpl({required this.id});
|
||||
|
||||
factory _$DiaryIndexModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DiaryIndexModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryIndexModel(id: $id)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryIndexModelImpl &&
|
||||
(identical(other.id, id) || other.id == id));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id);
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryIndexModelImplCopyWith<_$DiaryIndexModelImpl> get copyWith =>
|
||||
__$$DiaryIndexModelImplCopyWithImpl<_$DiaryIndexModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$DiaryIndexModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DiaryIndexModel implements DiaryIndexModel {
|
||||
const factory _DiaryIndexModel({required final int id}) =
|
||||
_$DiaryIndexModelImpl;
|
||||
|
||||
factory _DiaryIndexModel.fromJson(Map<String, dynamic> json) =
|
||||
_$DiaryIndexModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
|
||||
/// Create a copy of DiaryIndexModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryIndexModelImplCopyWith<_$DiaryIndexModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_index_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DiaryIndexModelImpl _$$DiaryIndexModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DiaryIndexModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DiaryIndexModelImplToJson(
|
||||
_$DiaryIndexModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
||||
@@ -1,213 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'finish_diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
FinishDiaryDayModel _$FinishDiaryDayModelFromJson(Map<String, dynamic> json) {
|
||||
return _FinishDiaryDayModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FinishDiaryDayModel {
|
||||
String get wakeUp => throw _privateConstructorUsedError;
|
||||
String get retire => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FinishDiaryDayModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FinishDiaryDayModelCopyWith<FinishDiaryDayModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FinishDiaryDayModelCopyWith<$Res> {
|
||||
factory $FinishDiaryDayModelCopyWith(
|
||||
FinishDiaryDayModel value, $Res Function(FinishDiaryDayModel) then) =
|
||||
_$FinishDiaryDayModelCopyWithImpl<$Res, FinishDiaryDayModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String wakeUp,
|
||||
String retire,
|
||||
@JsonKey(includeIfNull: false) String? comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FinishDiaryDayModelCopyWithImpl<$Res, $Val extends FinishDiaryDayModel>
|
||||
implements $FinishDiaryDayModelCopyWith<$Res> {
|
||||
_$FinishDiaryDayModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
Object? retire = null,
|
||||
Object? comment = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
wakeUp: null == wakeUp
|
||||
? _value.wakeUp
|
||||
: wakeUp // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
retire: null == retire
|
||||
? _value.retire
|
||||
: retire // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
comment: freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FinishDiaryDayModelImplCopyWith<$Res>
|
||||
implements $FinishDiaryDayModelCopyWith<$Res> {
|
||||
factory _$$FinishDiaryDayModelImplCopyWith(_$FinishDiaryDayModelImpl value,
|
||||
$Res Function(_$FinishDiaryDayModelImpl) then) =
|
||||
__$$FinishDiaryDayModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String wakeUp,
|
||||
String retire,
|
||||
@JsonKey(includeIfNull: false) String? comment});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FinishDiaryDayModelImplCopyWithImpl<$Res>
|
||||
extends _$FinishDiaryDayModelCopyWithImpl<$Res, _$FinishDiaryDayModelImpl>
|
||||
implements _$$FinishDiaryDayModelImplCopyWith<$Res> {
|
||||
__$$FinishDiaryDayModelImplCopyWithImpl(_$FinishDiaryDayModelImpl _value,
|
||||
$Res Function(_$FinishDiaryDayModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? wakeUp = null,
|
||||
Object? retire = null,
|
||||
Object? comment = freezed,
|
||||
}) {
|
||||
return _then(_$FinishDiaryDayModelImpl(
|
||||
wakeUp: null == wakeUp
|
||||
? _value.wakeUp
|
||||
: wakeUp // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
retire: null == retire
|
||||
? _value.retire
|
||||
: retire // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
comment: freezed == comment
|
||||
? _value.comment
|
||||
: comment // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FinishDiaryDayModelImpl implements _FinishDiaryDayModel {
|
||||
const _$FinishDiaryDayModelImpl(
|
||||
{required this.wakeUp,
|
||||
required this.retire,
|
||||
@JsonKey(includeIfNull: false) this.comment});
|
||||
|
||||
factory _$FinishDiaryDayModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FinishDiaryDayModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String wakeUp;
|
||||
@override
|
||||
final String retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? comment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FinishDiaryDayModel(wakeUp: $wakeUp, retire: $retire, comment: $comment)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FinishDiaryDayModelImpl &&
|
||||
(identical(other.wakeUp, wakeUp) || other.wakeUp == wakeUp) &&
|
||||
(identical(other.retire, retire) || other.retire == retire) &&
|
||||
(identical(other.comment, comment) || other.comment == comment));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, wakeUp, retire, comment);
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FinishDiaryDayModelImplCopyWith<_$FinishDiaryDayModelImpl> get copyWith =>
|
||||
__$$FinishDiaryDayModelImplCopyWithImpl<_$FinishDiaryDayModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FinishDiaryDayModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FinishDiaryDayModel implements FinishDiaryDayModel {
|
||||
const factory _FinishDiaryDayModel(
|
||||
{required final String wakeUp,
|
||||
required final String retire,
|
||||
@JsonKey(includeIfNull: false) final String? comment}) =
|
||||
_$FinishDiaryDayModelImpl;
|
||||
|
||||
factory _FinishDiaryDayModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FinishDiaryDayModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get wakeUp;
|
||||
@override
|
||||
String get retire;
|
||||
@override
|
||||
@JsonKey(includeIfNull: false)
|
||||
String? get comment;
|
||||
|
||||
/// Create a copy of FinishDiaryDayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FinishDiaryDayModelImplCopyWith<_$FinishDiaryDayModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'finish_diary_day_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FinishDiaryDayModelImpl _$$FinishDiaryDayModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FinishDiaryDayModelImpl(
|
||||
wakeUp: json['wakeUp'] as String,
|
||||
retire: json['retire'] as String,
|
||||
comment: json['comment'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FinishDiaryDayModelImplToJson(
|
||||
_$FinishDiaryDayModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'wakeUp': instance.wakeUp,
|
||||
'retire': instance.retire,
|
||||
if (instance.comment case final value?) 'comment': value,
|
||||
};
|
||||
@@ -1,437 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'nutrition_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
NutritionDataModel _$NutritionDataModelFromJson(Map<String, dynamic> json) {
|
||||
return _NutritionDataModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NutritionDataModel {
|
||||
NutritionModel get dailyNutritionIntake => throw _privateConstructorUsedError;
|
||||
NutritionModel get dailyNutritionRecommendation =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this NutritionDataModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$NutritionDataModelCopyWith<NutritionDataModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NutritionDataModelCopyWith<$Res> {
|
||||
factory $NutritionDataModelCopyWith(
|
||||
NutritionDataModel value, $Res Function(NutritionDataModel) then) =
|
||||
_$NutritionDataModelCopyWithImpl<$Res, NutritionDataModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{NutritionModel dailyNutritionIntake,
|
||||
NutritionModel dailyNutritionRecommendation});
|
||||
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel>
|
||||
implements $NutritionDataModelCopyWith<$Res> {
|
||||
_$NutritionDataModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? dailyNutritionIntake = null,
|
||||
Object? dailyNutritionRecommendation = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
dailyNutritionIntake: null == dailyNutritionIntake
|
||||
? _value.dailyNutritionIntake
|
||||
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionModel,
|
||||
dailyNutritionRecommendation: null == dailyNutritionRecommendation
|
||||
? _value.dailyNutritionRecommendation
|
||||
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionModel,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake {
|
||||
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionIntake, (value) {
|
||||
return _then(_value.copyWith(dailyNutritionIntake: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation {
|
||||
return $NutritionModelCopyWith<$Res>(_value.dailyNutritionRecommendation,
|
||||
(value) {
|
||||
return _then(
|
||||
_value.copyWith(dailyNutritionRecommendation: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NutritionDataModelImplCopyWith<$Res>
|
||||
implements $NutritionDataModelCopyWith<$Res> {
|
||||
factory _$$NutritionDataModelImplCopyWith(_$NutritionDataModelImpl value,
|
||||
$Res Function(_$NutritionDataModelImpl) then) =
|
||||
__$$NutritionDataModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{NutritionModel dailyNutritionIntake,
|
||||
NutritionModel dailyNutritionRecommendation});
|
||||
|
||||
@override
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionIntake;
|
||||
@override
|
||||
$NutritionModelCopyWith<$Res> get dailyNutritionRecommendation;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NutritionDataModelImplCopyWithImpl<$Res>
|
||||
extends _$NutritionDataModelCopyWithImpl<$Res, _$NutritionDataModelImpl>
|
||||
implements _$$NutritionDataModelImplCopyWith<$Res> {
|
||||
__$$NutritionDataModelImplCopyWithImpl(_$NutritionDataModelImpl _value,
|
||||
$Res Function(_$NutritionDataModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? dailyNutritionIntake = null,
|
||||
Object? dailyNutritionRecommendation = null,
|
||||
}) {
|
||||
return _then(_$NutritionDataModelImpl(
|
||||
dailyNutritionIntake: null == dailyNutritionIntake
|
||||
? _value.dailyNutritionIntake
|
||||
: dailyNutritionIntake // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionModel,
|
||||
dailyNutritionRecommendation: null == dailyNutritionRecommendation
|
||||
? _value.dailyNutritionRecommendation
|
||||
: dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionModel,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$NutritionDataModelImpl implements _NutritionDataModel {
|
||||
const _$NutritionDataModelImpl(
|
||||
{required this.dailyNutritionIntake,
|
||||
required this.dailyNutritionRecommendation});
|
||||
|
||||
factory _$NutritionDataModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$NutritionDataModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final NutritionModel dailyNutritionIntake;
|
||||
@override
|
||||
final NutritionModel dailyNutritionRecommendation;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NutritionDataModel(dailyNutritionIntake: $dailyNutritionIntake, dailyNutritionRecommendation: $dailyNutritionRecommendation)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NutritionDataModelImpl &&
|
||||
(identical(other.dailyNutritionIntake, dailyNutritionIntake) ||
|
||||
other.dailyNutritionIntake == dailyNutritionIntake) &&
|
||||
(identical(other.dailyNutritionRecommendation,
|
||||
dailyNutritionRecommendation) ||
|
||||
other.dailyNutritionRecommendation ==
|
||||
dailyNutritionRecommendation));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, dailyNutritionIntake, dailyNutritionRecommendation);
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith =>
|
||||
__$$NutritionDataModelImplCopyWithImpl<_$NutritionDataModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$NutritionDataModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _NutritionDataModel implements NutritionDataModel {
|
||||
const factory _NutritionDataModel(
|
||||
{required final NutritionModel dailyNutritionIntake,
|
||||
required final NutritionModel dailyNutritionRecommendation}) =
|
||||
_$NutritionDataModelImpl;
|
||||
|
||||
factory _NutritionDataModel.fromJson(Map<String, dynamic> json) =
|
||||
_$NutritionDataModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
NutritionModel get dailyNutritionIntake;
|
||||
@override
|
||||
NutritionModel get dailyNutritionRecommendation;
|
||||
|
||||
/// Create a copy of NutritionDataModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
NutritionModel _$NutritionModelFromJson(Map<String, dynamic> json) {
|
||||
return _NutritionModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$NutritionModel {
|
||||
double get energy => throw _privateConstructorUsedError;
|
||||
double get proteins => throw _privateConstructorUsedError;
|
||||
double get fats => throw _privateConstructorUsedError;
|
||||
double get carbohydrates => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this NutritionModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$NutritionModelCopyWith<NutritionModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $NutritionModelCopyWith<$Res> {
|
||||
factory $NutritionModelCopyWith(
|
||||
NutritionModel value, $Res Function(NutritionModel) then) =
|
||||
_$NutritionModelCopyWithImpl<$Res, NutritionModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{double energy, double proteins, double fats, double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$NutritionModelCopyWithImpl<$Res, $Val extends NutritionModel>
|
||||
implements $NutritionModelCopyWith<$Res> {
|
||||
_$NutritionModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
energy: null == energy
|
||||
? _value.energy
|
||||
: energy // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
proteins: null == proteins
|
||||
? _value.proteins
|
||||
: proteins // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
fats: null == fats
|
||||
? _value.fats
|
||||
: fats // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
carbohydrates: null == carbohydrates
|
||||
? _value.carbohydrates
|
||||
: carbohydrates // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$NutritionModelImplCopyWith<$Res>
|
||||
implements $NutritionModelCopyWith<$Res> {
|
||||
factory _$$NutritionModelImplCopyWith(_$NutritionModelImpl value,
|
||||
$Res Function(_$NutritionModelImpl) then) =
|
||||
__$$NutritionModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{double energy, double proteins, double fats, double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$NutritionModelImplCopyWithImpl<$Res>
|
||||
extends _$NutritionModelCopyWithImpl<$Res, _$NutritionModelImpl>
|
||||
implements _$$NutritionModelImplCopyWith<$Res> {
|
||||
__$$NutritionModelImplCopyWithImpl(
|
||||
_$NutritionModelImpl _value, $Res Function(_$NutritionModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_$NutritionModelImpl(
|
||||
energy: null == energy
|
||||
? _value.energy
|
||||
: energy // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
proteins: null == proteins
|
||||
? _value.proteins
|
||||
: proteins // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
fats: null == fats
|
||||
? _value.fats
|
||||
: fats // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
carbohydrates: null == carbohydrates
|
||||
? _value.carbohydrates
|
||||
: carbohydrates // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$NutritionModelImpl implements _NutritionModel {
|
||||
const _$NutritionModelImpl(
|
||||
{required this.energy,
|
||||
required this.proteins,
|
||||
required this.fats,
|
||||
required this.carbohydrates});
|
||||
|
||||
factory _$NutritionModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$NutritionModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final double energy;
|
||||
@override
|
||||
final double proteins;
|
||||
@override
|
||||
final double fats;
|
||||
@override
|
||||
final double carbohydrates;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NutritionModel(energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$NutritionModelImpl &&
|
||||
(identical(other.energy, energy) || other.energy == energy) &&
|
||||
(identical(other.proteins, proteins) ||
|
||||
other.proteins == proteins) &&
|
||||
(identical(other.fats, fats) || other.fats == fats) &&
|
||||
(identical(other.carbohydrates, carbohydrates) ||
|
||||
other.carbohydrates == carbohydrates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, energy, proteins, fats, carbohydrates);
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith =>
|
||||
__$$NutritionModelImplCopyWithImpl<_$NutritionModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$NutritionModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _NutritionModel implements NutritionModel {
|
||||
const factory _NutritionModel(
|
||||
{required final double energy,
|
||||
required final double proteins,
|
||||
required final double fats,
|
||||
required final double carbohydrates}) = _$NutritionModelImpl;
|
||||
|
||||
factory _NutritionModel.fromJson(Map<String, dynamic> json) =
|
||||
_$NutritionModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
double get energy;
|
||||
@override
|
||||
double get proteins;
|
||||
@override
|
||||
double get fats;
|
||||
@override
|
||||
double get carbohydrates;
|
||||
|
||||
/// Create a copy of NutritionModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'nutrition_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$NutritionDataModelImpl _$$NutritionDataModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$NutritionDataModelImpl(
|
||||
dailyNutritionIntake: NutritionModel.fromJson(
|
||||
json['dailyNutritionIntake'] as Map<String, dynamic>),
|
||||
dailyNutritionRecommendation: NutritionModel.fromJson(
|
||||
json['dailyNutritionRecommendation'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$NutritionDataModelImplToJson(
|
||||
_$NutritionDataModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'dailyNutritionIntake': instance.dailyNutritionIntake,
|
||||
'dailyNutritionRecommendation': instance.dailyNutritionRecommendation,
|
||||
};
|
||||
|
||||
_$NutritionModelImpl _$$NutritionModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$NutritionModelImpl(
|
||||
energy: (json['energy'] as num).toDouble(),
|
||||
proteins: (json['proteins'] as num).toDouble(),
|
||||
fats: (json['fats'] as num).toDouble(),
|
||||
carbohydrates: (json['carbohydrates'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$NutritionModelImplToJson(
|
||||
_$NutritionModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'energy': instance.energy,
|
||||
'proteins': instance.proteins,
|
||||
'fats': instance.fats,
|
||||
'carbohydrates': instance.carbohydrates,
|
||||
};
|
||||
@@ -1,270 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'product_moderation_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
ProductModerationModel _$ProductModerationModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _ProductModerationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProductModerationModel {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
double get energy => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
double get proteins => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
double get fats => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
double get carbohydrates => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ProductModerationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$ProductModerationModelCopyWith<ProductModerationModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ProductModerationModelCopyWith<$Res> {
|
||||
factory $ProductModerationModelCopyWith(ProductModerationModel value,
|
||||
$Res Function(ProductModerationModel) then) =
|
||||
_$ProductModerationModelCopyWithImpl<$Res, ProductModerationModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String name,
|
||||
@JsonKey(name: 'energy_on_100gr') double energy,
|
||||
@JsonKey(name: 'proteins_on_100gr') double proteins,
|
||||
@JsonKey(name: 'fats_on_100gr') double fats,
|
||||
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ProductModerationModelCopyWithImpl<$Res,
|
||||
$Val extends ProductModerationModel>
|
||||
implements $ProductModerationModelCopyWith<$Res> {
|
||||
_$ProductModerationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
energy: null == energy
|
||||
? _value.energy
|
||||
: energy // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
proteins: null == proteins
|
||||
? _value.proteins
|
||||
: proteins // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
fats: null == fats
|
||||
? _value.fats
|
||||
: fats // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
carbohydrates: null == carbohydrates
|
||||
? _value.carbohydrates
|
||||
: carbohydrates // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ProductModerationModelImplCopyWith<$Res>
|
||||
implements $ProductModerationModelCopyWith<$Res> {
|
||||
factory _$$ProductModerationModelImplCopyWith(
|
||||
_$ProductModerationModelImpl value,
|
||||
$Res Function(_$ProductModerationModelImpl) then) =
|
||||
__$$ProductModerationModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String name,
|
||||
@JsonKey(name: 'energy_on_100gr') double energy,
|
||||
@JsonKey(name: 'proteins_on_100gr') double proteins,
|
||||
@JsonKey(name: 'fats_on_100gr') double fats,
|
||||
@JsonKey(name: 'carbohydrates_on_100gr') double carbohydrates});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ProductModerationModelImplCopyWithImpl<$Res>
|
||||
extends _$ProductModerationModelCopyWithImpl<$Res,
|
||||
_$ProductModerationModelImpl>
|
||||
implements _$$ProductModerationModelImplCopyWith<$Res> {
|
||||
__$$ProductModerationModelImplCopyWithImpl(
|
||||
_$ProductModerationModelImpl _value,
|
||||
$Res Function(_$ProductModerationModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? name = null,
|
||||
Object? energy = null,
|
||||
Object? proteins = null,
|
||||
Object? fats = null,
|
||||
Object? carbohydrates = null,
|
||||
}) {
|
||||
return _then(_$ProductModerationModelImpl(
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
energy: null == energy
|
||||
? _value.energy
|
||||
: energy // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
proteins: null == proteins
|
||||
? _value.proteins
|
||||
: proteins // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
fats: null == fats
|
||||
? _value.fats
|
||||
: fats // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
carbohydrates: null == carbohydrates
|
||||
? _value.carbohydrates
|
||||
: carbohydrates // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$ProductModerationModelImpl implements _ProductModerationModel {
|
||||
const _$ProductModerationModelImpl(
|
||||
{required this.name,
|
||||
@JsonKey(name: 'energy_on_100gr') required this.energy,
|
||||
@JsonKey(name: 'proteins_on_100gr') required this.proteins,
|
||||
@JsonKey(name: 'fats_on_100gr') required this.fats,
|
||||
@JsonKey(name: 'carbohydrates_on_100gr') required this.carbohydrates});
|
||||
|
||||
factory _$ProductModerationModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ProductModerationModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
final double energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
final double proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
final double fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
final double carbohydrates;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProductModerationModel(name: $name, energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ProductModerationModelImpl &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.energy, energy) || other.energy == energy) &&
|
||||
(identical(other.proteins, proteins) ||
|
||||
other.proteins == proteins) &&
|
||||
(identical(other.fats, fats) || other.fats == fats) &&
|
||||
(identical(other.carbohydrates, carbohydrates) ||
|
||||
other.carbohydrates == carbohydrates));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, name, energy, proteins, fats, carbohydrates);
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
|
||||
get copyWith => __$$ProductModerationModelImplCopyWithImpl<
|
||||
_$ProductModerationModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$ProductModerationModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _ProductModerationModel implements ProductModerationModel {
|
||||
const factory _ProductModerationModel(
|
||||
{required final String name,
|
||||
@JsonKey(name: 'energy_on_100gr') required final double energy,
|
||||
@JsonKey(name: 'proteins_on_100gr') required final double proteins,
|
||||
@JsonKey(name: 'fats_on_100gr') required final double fats,
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
required final double carbohydrates}) = _$ProductModerationModelImpl;
|
||||
|
||||
factory _ProductModerationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$ProductModerationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: 'energy_on_100gr')
|
||||
double get energy;
|
||||
@override
|
||||
@JsonKey(name: 'proteins_on_100gr')
|
||||
double get proteins;
|
||||
@override
|
||||
@JsonKey(name: 'fats_on_100gr')
|
||||
double get fats;
|
||||
@override
|
||||
@JsonKey(name: 'carbohydrates_on_100gr')
|
||||
double get carbohydrates;
|
||||
|
||||
/// Create a copy of ProductModerationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ProductModerationModelImplCopyWith<_$ProductModerationModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'product_moderation_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ProductModerationModelImpl _$$ProductModerationModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ProductModerationModelImpl(
|
||||
name: json['name'] as String,
|
||||
energy: (json['energy_on_100gr'] as num).toDouble(),
|
||||
proteins: (json['proteins_on_100gr'] as num).toDouble(),
|
||||
fats: (json['fats_on_100gr'] as num).toDouble(),
|
||||
carbohydrates: (json['carbohydrates_on_100gr'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ProductModerationModelImplToJson(
|
||||
_$ProductModerationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'energy_on_100gr': instance.energy,
|
||||
'proteins_on_100gr': instance.proteins,
|
||||
'fats_on_100gr': instance.fats,
|
||||
'carbohydrates_on_100gr': instance.carbohydrates,
|
||||
};
|
||||
@@ -1,728 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'diary_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DiaryState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DiaryStateCopyWith<$Res> {
|
||||
factory $DiaryStateCopyWith(
|
||||
DiaryState value, $Res Function(DiaryState) then) =
|
||||
_$DiaryStateCopyWithImpl<$Res, DiaryState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState>
|
||||
implements $DiaryStateCopyWith<$Res> {
|
||||
_$DiaryStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateImplCopyWith(
|
||||
_$DiaryStateImpl value, $Res Function(_$DiaryStateImpl) then) =
|
||||
__$$DiaryStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateImpl>
|
||||
implements _$$DiaryStateImplCopyWith<$Res> {
|
||||
__$$DiaryStateImplCopyWithImpl(
|
||||
_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateImpl implements _DiaryState {
|
||||
const _$DiaryStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DiaryStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DiaryState implements DiaryState {
|
||||
const factory _DiaryState() = _$DiaryStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateLoadingImplCopyWith(_$DiaryStateLoadingImpl value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) then) =
|
||||
__$$DiaryStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadingImpl>
|
||||
implements _$$DiaryStateLoadingImplCopyWith<$Res> {
|
||||
__$$DiaryStateLoadingImplCopyWithImpl(_$DiaryStateLoadingImpl _value,
|
||||
$Res Function(_$DiaryStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateLoadingImpl implements DiaryStateLoading {
|
||||
const _$DiaryStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DiaryStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DiaryStateLoading implements DiaryState {
|
||||
const factory DiaryStateLoading() = _$DiaryStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateErrorImplCopyWith(_$DiaryStateErrorImpl value,
|
||||
$Res Function(_$DiaryStateErrorImpl) then) =
|
||||
__$$DiaryStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String errorMessage});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateErrorImpl>
|
||||
implements _$$DiaryStateErrorImplCopyWith<$Res> {
|
||||
__$$DiaryStateErrorImplCopyWithImpl(
|
||||
_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? errorMessage = null,
|
||||
}) {
|
||||
return _then(_$DiaryStateErrorImpl(
|
||||
errorMessage: null == errorMessage
|
||||
? _value.errorMessage
|
||||
: errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateErrorImpl implements DiaryStateError {
|
||||
const _$DiaryStateErrorImpl({required this.errorMessage});
|
||||
|
||||
@override
|
||||
final String errorMessage;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.error(errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryStateErrorImpl &&
|
||||
(identical(other.errorMessage, errorMessage) ||
|
||||
other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, errorMessage);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
|
||||
__$$DiaryStateErrorImplCopyWithImpl<_$DiaryStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return error?.call(errorMessage);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(errorMessage);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DiaryStateError implements DiaryState {
|
||||
const factory DiaryStateError({required final String errorMessage}) =
|
||||
_$DiaryStateErrorImpl;
|
||||
|
||||
String get errorMessage;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$DiaryStateLoadedImplCopyWith(_$DiaryStateLoadedImpl value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) then) =
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{DiaryDayModel diary,
|
||||
NutritionDataModel nutrition,
|
||||
DateTime selectedDay,
|
||||
int selectedMeal});
|
||||
|
||||
$DiaryDayModelCopyWith<$Res> get diary;
|
||||
$NutritionDataModelCopyWith<$Res> get nutrition;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$DiaryStateCopyWithImpl<$Res, _$DiaryStateLoadedImpl>
|
||||
implements _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
__$$DiaryStateLoadedImplCopyWithImpl(_$DiaryStateLoadedImpl _value,
|
||||
$Res Function(_$DiaryStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? diary = null,
|
||||
Object? nutrition = null,
|
||||
Object? selectedDay = null,
|
||||
Object? selectedMeal = null,
|
||||
}) {
|
||||
return _then(_$DiaryStateLoadedImpl(
|
||||
diary: null == diary
|
||||
? _value.diary
|
||||
: diary // ignore: cast_nullable_to_non_nullable
|
||||
as DiaryDayModel,
|
||||
nutrition: null == nutrition
|
||||
? _value.nutrition
|
||||
: nutrition // ignore: cast_nullable_to_non_nullable
|
||||
as NutritionDataModel,
|
||||
selectedDay: null == selectedDay
|
||||
? _value.selectedDay
|
||||
: selectedDay // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
selectedMeal: null == selectedMeal
|
||||
? _value.selectedMeal
|
||||
: selectedMeal // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DiaryDayModelCopyWith<$Res> get diary {
|
||||
return $DiaryDayModelCopyWith<$Res>(_value.diary, (value) {
|
||||
return _then(_value.copyWith(diary: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$NutritionDataModelCopyWith<$Res> get nutrition {
|
||||
return $NutritionDataModelCopyWith<$Res>(_value.nutrition, (value) {
|
||||
return _then(_value.copyWith(nutrition: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
|
||||
const _$DiaryStateLoadedImpl(
|
||||
{required this.diary,
|
||||
required this.nutrition,
|
||||
required this.selectedDay,
|
||||
required this.selectedMeal});
|
||||
|
||||
@override
|
||||
final DiaryDayModel diary;
|
||||
@override
|
||||
final NutritionDataModel nutrition;
|
||||
@override
|
||||
final DateTime selectedDay;
|
||||
@override
|
||||
final int selectedMeal;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DiaryState.loaded(diary: $diary, nutrition: $nutrition, selectedDay: $selectedDay, selectedMeal: $selectedMeal)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DiaryStateLoadedImpl &&
|
||||
(identical(other.diary, diary) || other.diary == diary) &&
|
||||
(identical(other.nutrition, nutrition) ||
|
||||
other.nutrition == nutrition) &&
|
||||
(identical(other.selectedDay, selectedDay) ||
|
||||
other.selectedDay == selectedDay) &&
|
||||
(identical(other.selectedMeal, selectedMeal) ||
|
||||
other.selectedMeal == selectedMeal));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, diary, nutrition, selectedDay, selectedMeal);
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
|
||||
__$$DiaryStateLoadedImplCopyWithImpl<_$DiaryStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() loading,
|
||||
required TResult Function(String errorMessage) error,
|
||||
required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)
|
||||
loaded,
|
||||
}) {
|
||||
return loaded(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(String errorMessage)? error,
|
||||
TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
}) {
|
||||
return loaded?.call(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? loading,
|
||||
TResult Function(String errorMessage)? error,
|
||||
TResult Function(DiaryDayModel diary, NutritionDataModel nutrition,
|
||||
DateTime selectedDay, int selectedMeal)?
|
||||
loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(diary, nutrition, selectedDay, selectedMeal);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value) $default, {
|
||||
required TResult Function(DiaryStateLoading value) loading,
|
||||
required TResult Function(DiaryStateError value) error,
|
||||
required TResult Function(DiaryStateLoaded value) loaded,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_DiaryState value)? $default, {
|
||||
TResult? Function(DiaryStateLoading value)? loading,
|
||||
TResult? Function(DiaryStateError value)? error,
|
||||
TResult? Function(DiaryStateLoaded value)? loaded,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_DiaryState value)? $default, {
|
||||
TResult Function(DiaryStateLoading value)? loading,
|
||||
TResult Function(DiaryStateError value)? error,
|
||||
TResult Function(DiaryStateLoaded value)? loaded,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DiaryStateLoaded implements DiaryState {
|
||||
const factory DiaryStateLoaded(
|
||||
{required final DiaryDayModel diary,
|
||||
required final NutritionDataModel nutrition,
|
||||
required final DateTime selectedDay,
|
||||
required final int selectedMeal}) = _$DiaryStateLoadedImpl;
|
||||
|
||||
DiaryDayModel get diary;
|
||||
NutritionDataModel get nutrition;
|
||||
DateTime get selectedDay;
|
||||
int get selectedMeal;
|
||||
|
||||
/// Create a copy of DiaryState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,507 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diary_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _DiaryService implements DiaryService {
|
||||
_DiaryService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<List<DiaryDayModel>> getDiaryIndexByDate({
|
||||
required String date,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<List<DiaryDayModel>>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/index/${date}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<List<dynamic>>(_options);
|
||||
late List<DiaryDayModel> _value;
|
||||
try {
|
||||
_value = _result.data!
|
||||
.map(
|
||||
(dynamic i) => DiaryDayModel.fromJson(i as Map<String, dynamic>),
|
||||
)
|
||||
.toList();
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<DiaryDayWrapperModel> getDiaryDay({required int diary}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<DiaryDayWrapperModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/show',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late DiaryDayWrapperModel _value;
|
||||
try {
|
||||
_value = DiaryDayWrapperModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<NutritionDataModel> getNutrition({required int diary}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<NutritionDataModel>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/dailyNutritionData',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late NutritionDataModel _value;
|
||||
try {
|
||||
_value = NutritionDataModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> uploadPhotoOfMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required File photo,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.files.add(
|
||||
MapEntry(
|
||||
'photo',
|
||||
MultipartFile.fromFileSync(
|
||||
photo.path,
|
||||
filename: photo.path.split(Platform.pathSeparator).last,
|
||||
),
|
||||
),
|
||||
);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(
|
||||
method: 'POST',
|
||||
headers: _headers,
|
||||
extra: _extra,
|
||||
contentType: 'multipart/form-data',
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/photo/upload',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deletePhotoOfMeal({
|
||||
required int diaryId,
|
||||
required int typeNo,
|
||||
required int userAttachment,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diaryId}/meals/${typeNo}/photo/${userAttachment}/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> addProductToMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required String productName,
|
||||
required String portion,
|
||||
required int quantity,
|
||||
int? productNutritionalValueId,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
queryParameters.removeWhere((k, v) => v == null);
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = FormData();
|
||||
_data.fields.add(MapEntry('product_name', productName));
|
||||
_data.fields.add(MapEntry('portion', portion));
|
||||
_data.fields.add(MapEntry('quantity', quantity.toString()));
|
||||
if (productNutritionalValueId != null) {
|
||||
_data.fields.add(
|
||||
MapEntry(
|
||||
'product_nutritional_value_id',
|
||||
productNutritionalValueId.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portion/create',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateProductInMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
required Map<String, dynamic> productInMeal,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(productInMeal);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'PUT', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/update',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> markEaten({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/mark_eaten',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> unmarkEaten({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/${portionModel}/unmark_eaten',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restore({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/restore',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteProductFromMeal({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int portionModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'DELETE', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/portions/${portionModel}/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> finishDiaryDay({
|
||||
required int diary,
|
||||
required FinishDiaryDayModel finishDiaryDayModel,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = finishDiaryDayModel;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/finishDay',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillSatiety({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int satiety,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'satiety': satiety};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/satiety/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillMood({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required int mood,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'mood': mood};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/mood/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillTime({
|
||||
required int diary,
|
||||
required int typeNo,
|
||||
required String time,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'time': time};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/meals/${typeNo}/time/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillWakeup({required int diary, required String wakeUp}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'wakeUp': wakeUp};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/wakeUp/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> fillRetire({required int diary, required String retire}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = {'retire': retire};
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/${diary}/retire/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GlossaryModerationModel> sendProductToModeration({
|
||||
required Map<String, dynamic> data,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(data);
|
||||
final _options = _setStreamType<GlossaryModerationModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diary/product_nutritional_values/sendToModeration',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late GlossaryModerationModel _value;
|
||||
try {
|
||||
_value = GlossaryModerationModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'diet_likes_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
DietLikesModel _$DietLikesModelFromJson(Map<String, dynamic> json) {
|
||||
return _DietLikesModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DietLikesModel {
|
||||
@JsonKey(name: 'total_likers')
|
||||
int get totalLikes => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'is_liked')
|
||||
bool get isLiked => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this DietLikesModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of DietLikesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$DietLikesModelCopyWith<DietLikesModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $DietLikesModelCopyWith<$Res> {
|
||||
factory $DietLikesModelCopyWith(
|
||||
DietLikesModel value, $Res Function(DietLikesModel) then) =
|
||||
_$DietLikesModelCopyWithImpl<$Res, DietLikesModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'total_likers') int totalLikes,
|
||||
@JsonKey(name: 'is_liked') bool isLiked});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$DietLikesModelCopyWithImpl<$Res, $Val extends DietLikesModel>
|
||||
implements $DietLikesModelCopyWith<$Res> {
|
||||
_$DietLikesModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of DietLikesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? totalLikes = null,
|
||||
Object? isLiked = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
totalLikes: null == totalLikes
|
||||
? _value.totalLikes
|
||||
: totalLikes // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
isLiked: null == isLiked
|
||||
? _value.isLiked
|
||||
: isLiked // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DietLikesModelImplCopyWith<$Res>
|
||||
implements $DietLikesModelCopyWith<$Res> {
|
||||
factory _$$DietLikesModelImplCopyWith(_$DietLikesModelImpl value,
|
||||
$Res Function(_$DietLikesModelImpl) then) =
|
||||
__$$DietLikesModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'total_likers') int totalLikes,
|
||||
@JsonKey(name: 'is_liked') bool isLiked});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DietLikesModelImplCopyWithImpl<$Res>
|
||||
extends _$DietLikesModelCopyWithImpl<$Res, _$DietLikesModelImpl>
|
||||
implements _$$DietLikesModelImplCopyWith<$Res> {
|
||||
__$$DietLikesModelImplCopyWithImpl(
|
||||
_$DietLikesModelImpl _value, $Res Function(_$DietLikesModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of DietLikesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? totalLikes = null,
|
||||
Object? isLiked = null,
|
||||
}) {
|
||||
return _then(_$DietLikesModelImpl(
|
||||
totalLikes: null == totalLikes
|
||||
? _value.totalLikes
|
||||
: totalLikes // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
isLiked: null == isLiked
|
||||
? _value.isLiked
|
||||
: isLiked // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$DietLikesModelImpl implements _DietLikesModel {
|
||||
const _$DietLikesModelImpl(
|
||||
{@JsonKey(name: 'total_likers') required this.totalLikes,
|
||||
@JsonKey(name: 'is_liked') required this.isLiked});
|
||||
|
||||
factory _$DietLikesModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DietLikesModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'total_likers')
|
||||
final int totalLikes;
|
||||
@override
|
||||
@JsonKey(name: 'is_liked')
|
||||
final bool isLiked;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DietLikesModel(totalLikes: $totalLikes, isLiked: $isLiked)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DietLikesModelImpl &&
|
||||
(identical(other.totalLikes, totalLikes) ||
|
||||
other.totalLikes == totalLikes) &&
|
||||
(identical(other.isLiked, isLiked) || other.isLiked == isLiked));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, totalLikes, isLiked);
|
||||
|
||||
/// Create a copy of DietLikesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DietLikesModelImplCopyWith<_$DietLikesModelImpl> get copyWith =>
|
||||
__$$DietLikesModelImplCopyWithImpl<_$DietLikesModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$DietLikesModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _DietLikesModel implements DietLikesModel {
|
||||
const factory _DietLikesModel(
|
||||
{@JsonKey(name: 'total_likers') required final int totalLikes,
|
||||
@JsonKey(name: 'is_liked') required final bool isLiked}) =
|
||||
_$DietLikesModelImpl;
|
||||
|
||||
factory _DietLikesModel.fromJson(Map<String, dynamic> json) =
|
||||
_$DietLikesModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'total_likers')
|
||||
int get totalLikes;
|
||||
@override
|
||||
@JsonKey(name: 'is_liked')
|
||||
bool get isLiked;
|
||||
|
||||
/// Create a copy of DietLikesModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DietLikesModelImplCopyWith<_$DietLikesModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diet_likes_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DietLikesModelImpl _$$DietLikesModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DietLikesModelImpl(
|
||||
totalLikes: (json['total_likers'] as num).toInt(),
|
||||
isLiked: json['is_liked'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DietLikesModelImplToJson(
|
||||
_$DietLikesModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'total_likers': instance.totalLikes,
|
||||
'is_liked': instance.isLiked,
|
||||
};
|
||||
@@ -1,830 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'about_diet_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AboutDietState {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $AboutDietStateCopyWith<$Res> {
|
||||
factory $AboutDietStateCopyWith(
|
||||
AboutDietState value, $Res Function(AboutDietState) then) =
|
||||
_$AboutDietStateCopyWithImpl<$Res, AboutDietState>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$AboutDietStateCopyWithImpl<$Res, $Val extends AboutDietState>
|
||||
implements $AboutDietStateCopyWith<$Res> {
|
||||
_$AboutDietStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$AboutDietStateImplCopyWith<$Res> {
|
||||
factory _$$AboutDietStateImplCopyWith(_$AboutDietStateImpl value,
|
||||
$Res Function(_$AboutDietStateImpl) then) =
|
||||
__$$AboutDietStateImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$AboutDietStateImplCopyWithImpl<$Res>
|
||||
extends _$AboutDietStateCopyWithImpl<$Res, _$AboutDietStateImpl>
|
||||
implements _$$AboutDietStateImplCopyWith<$Res> {
|
||||
__$$AboutDietStateImplCopyWithImpl(
|
||||
_$AboutDietStateImpl _value, $Res Function(_$AboutDietStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$AboutDietStateImpl implements _AboutDietState {
|
||||
const _$AboutDietStateImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutDietState()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$AboutDietStateImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return $default();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return $default?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) {
|
||||
return $default(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) {
|
||||
return $default?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if ($default != null) {
|
||||
return $default(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _AboutDietState implements AboutDietState {
|
||||
const factory _AboutDietState() = _$AboutDietStateImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DietStateInitialImplCopyWith<$Res> {
|
||||
factory _$$DietStateInitialImplCopyWith(_$DietStateInitialImpl value,
|
||||
$Res Function(_$DietStateInitialImpl) then) =
|
||||
__$$DietStateInitialImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DietStateInitialImplCopyWithImpl<$Res>
|
||||
extends _$AboutDietStateCopyWithImpl<$Res, _$DietStateInitialImpl>
|
||||
implements _$$DietStateInitialImplCopyWith<$Res> {
|
||||
__$$DietStateInitialImplCopyWithImpl(_$DietStateInitialImpl _value,
|
||||
$Res Function(_$DietStateInitialImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DietStateInitialImpl implements DietStateInitial {
|
||||
const _$DietStateInitialImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutDietState.initial()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DietStateInitialImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return initial();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return initial?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (initial != null) {
|
||||
return initial();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) {
|
||||
return initial(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) {
|
||||
return initial?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (initial != null) {
|
||||
return initial(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DietStateInitial implements AboutDietState {
|
||||
const factory DietStateInitial() = _$DietStateInitialImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DietStateLoadingImplCopyWith<$Res> {
|
||||
factory _$$DietStateLoadingImplCopyWith(_$DietStateLoadingImpl value,
|
||||
$Res Function(_$DietStateLoadingImpl) then) =
|
||||
__$$DietStateLoadingImplCopyWithImpl<$Res>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DietStateLoadingImplCopyWithImpl<$Res>
|
||||
extends _$AboutDietStateCopyWithImpl<$Res, _$DietStateLoadingImpl>
|
||||
implements _$$DietStateLoadingImplCopyWith<$Res> {
|
||||
__$$DietStateLoadingImplCopyWithImpl(_$DietStateLoadingImpl _value,
|
||||
$Res Function(_$DietStateLoadingImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DietStateLoadingImpl implements DietStateLoading {
|
||||
const _$DietStateLoadingImpl();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutDietState.loading()';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType && other is _$DietStateLoadingImpl);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => runtimeType.hashCode;
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return loading();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return loading?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading();
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) {
|
||||
return loading(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) {
|
||||
return loading?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loading != null) {
|
||||
return loading(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DietStateLoading implements AboutDietState {
|
||||
const factory DietStateLoading() = _$DietStateLoadingImpl;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DietStateLoadedImplCopyWith<$Res> {
|
||||
factory _$$DietStateLoadedImplCopyWith(_$DietStateLoadedImpl value,
|
||||
$Res Function(_$DietStateLoadedImpl) then) =
|
||||
__$$DietStateLoadedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Diet diet, bool isStarted, bool hasStartedDiet});
|
||||
|
||||
$DietCopyWith<$Res> get diet;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DietStateLoadedImplCopyWithImpl<$Res>
|
||||
extends _$AboutDietStateCopyWithImpl<$Res, _$DietStateLoadedImpl>
|
||||
implements _$$DietStateLoadedImplCopyWith<$Res> {
|
||||
__$$DietStateLoadedImplCopyWithImpl(
|
||||
_$DietStateLoadedImpl _value, $Res Function(_$DietStateLoadedImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? diet = null,
|
||||
Object? isStarted = null,
|
||||
Object? hasStartedDiet = null,
|
||||
}) {
|
||||
return _then(_$DietStateLoadedImpl(
|
||||
diet: null == diet
|
||||
? _value.diet
|
||||
: diet // ignore: cast_nullable_to_non_nullable
|
||||
as Diet,
|
||||
isStarted: null == isStarted
|
||||
? _value.isStarted
|
||||
: isStarted // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hasStartedDiet: null == hasStartedDiet
|
||||
? _value.hasStartedDiet
|
||||
: hasStartedDiet // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DietCopyWith<$Res> get diet {
|
||||
return $DietCopyWith<$Res>(_value.diet, (value) {
|
||||
return _then(_value.copyWith(diet: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DietStateLoadedImpl implements DietStateLoaded {
|
||||
const _$DietStateLoadedImpl(
|
||||
{required this.diet,
|
||||
this.isStarted = false,
|
||||
this.hasStartedDiet = false});
|
||||
|
||||
@override
|
||||
final Diet diet;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isStarted;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool hasStartedDiet;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutDietState.loaded(diet: $diet, isStarted: $isStarted, hasStartedDiet: $hasStartedDiet)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DietStateLoadedImpl &&
|
||||
(identical(other.diet, diet) || other.diet == diet) &&
|
||||
(identical(other.isStarted, isStarted) ||
|
||||
other.isStarted == isStarted) &&
|
||||
(identical(other.hasStartedDiet, hasStartedDiet) ||
|
||||
other.hasStartedDiet == hasStartedDiet));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, diet, isStarted, hasStartedDiet);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DietStateLoadedImplCopyWith<_$DietStateLoadedImpl> get copyWith =>
|
||||
__$$DietStateLoadedImplCopyWithImpl<_$DietStateLoadedImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return loaded(diet, isStarted, hasStartedDiet);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return loaded?.call(diet, isStarted, hasStartedDiet);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(diet, isStarted, hasStartedDiet);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) {
|
||||
return loaded(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) {
|
||||
return loaded?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (loaded != null) {
|
||||
return loaded(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DietStateLoaded implements AboutDietState {
|
||||
const factory DietStateLoaded(
|
||||
{required final Diet diet,
|
||||
final bool isStarted,
|
||||
final bool hasStartedDiet}) = _$DietStateLoadedImpl;
|
||||
|
||||
Diet get diet;
|
||||
bool get isStarted;
|
||||
bool get hasStartedDiet;
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DietStateLoadedImplCopyWith<_$DietStateLoadedImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$DietStateErrorImplCopyWith<$Res> {
|
||||
factory _$$DietStateErrorImplCopyWith(_$DietStateErrorImpl value,
|
||||
$Res Function(_$DietStateErrorImpl) then) =
|
||||
__$$DietStateErrorImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String message});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$DietStateErrorImplCopyWithImpl<$Res>
|
||||
extends _$AboutDietStateCopyWithImpl<$Res, _$DietStateErrorImpl>
|
||||
implements _$$DietStateErrorImplCopyWith<$Res> {
|
||||
__$$DietStateErrorImplCopyWithImpl(
|
||||
_$DietStateErrorImpl _value, $Res Function(_$DietStateErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
}) {
|
||||
return _then(_$DietStateErrorImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$DietStateErrorImpl implements DietStateError {
|
||||
const _$DietStateErrorImpl({required this.message});
|
||||
|
||||
@override
|
||||
final String message;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AboutDietState.error(message: $message)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$DietStateErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message);
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$DietStateErrorImplCopyWith<_$DietStateErrorImpl> get copyWith =>
|
||||
__$$DietStateErrorImplCopyWithImpl<_$DietStateErrorImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>(
|
||||
TResult Function() $default, {
|
||||
required TResult Function() initial,
|
||||
required TResult Function() loading,
|
||||
required TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)
|
||||
loaded,
|
||||
required TResult Function(String message) error,
|
||||
}) {
|
||||
return error(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>(
|
||||
TResult? Function()? $default, {
|
||||
TResult? Function()? initial,
|
||||
TResult? Function()? loading,
|
||||
TResult? Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult? Function(String message)? error,
|
||||
}) {
|
||||
return error?.call(message);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>(
|
||||
TResult Function()? $default, {
|
||||
TResult Function()? initial,
|
||||
TResult Function()? loading,
|
||||
TResult Function(Diet diet, bool isStarted, bool hasStartedDiet)? loaded,
|
||||
TResult Function(String message)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(message);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult map<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value) $default, {
|
||||
required TResult Function(DietStateInitial value) initial,
|
||||
required TResult Function(DietStateLoading value) loading,
|
||||
required TResult Function(DietStateLoaded value) loaded,
|
||||
required TResult Function(DietStateError value) error,
|
||||
}) {
|
||||
return error(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult? mapOrNull<TResult extends Object?>(
|
||||
TResult? Function(_AboutDietState value)? $default, {
|
||||
TResult? Function(DietStateInitial value)? initial,
|
||||
TResult? Function(DietStateLoading value)? loading,
|
||||
TResult? Function(DietStateLoaded value)? loaded,
|
||||
TResult? Function(DietStateError value)? error,
|
||||
}) {
|
||||
return error?.call(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_AboutDietState value)? $default, {
|
||||
TResult Function(DietStateInitial value)? initial,
|
||||
TResult Function(DietStateLoading value)? loading,
|
||||
TResult Function(DietStateLoaded value)? loaded,
|
||||
TResult Function(DietStateError value)? error,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
if (error != null) {
|
||||
return error(this);
|
||||
}
|
||||
return orElse();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DietStateError implements AboutDietState {
|
||||
const factory DietStateError({required final String message}) =
|
||||
_$DietStateErrorImpl;
|
||||
|
||||
String get message;
|
||||
|
||||
/// Create a copy of AboutDietState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$DietStateErrorImplCopyWith<_$DietStateErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diet_service.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RetrofitGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
|
||||
|
||||
class _DietService implements DietService {
|
||||
_DietService(this._dio, {this.baseUrl, this.errorLogger});
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
String? baseUrl;
|
||||
|
||||
final ParseErrorLogger? errorLogger;
|
||||
|
||||
@override
|
||||
Future<DietLikesModel> likeDiet({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<DietLikesModel>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/like',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late DietLikesModel _value;
|
||||
try {
|
||||
_value = DietLikesModel.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Diet> addToFavorite({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Diet>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/add_to_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Diet _value;
|
||||
try {
|
||||
_value = Diet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Diet> removeFromFavorite({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Diet>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/remove_from_favorite',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Diet _value;
|
||||
try {
|
||||
_value = Diet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Diet> getDiet({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<Diet>(
|
||||
Options(method: 'GET', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/show/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
||||
late Diet _value;
|
||||
try {
|
||||
_value = Diet.fromJson(_result.data!);
|
||||
} on Object catch (e, s) {
|
||||
errorLogger?.logError(e, s, _options);
|
||||
rethrow;
|
||||
}
|
||||
return _value;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> startDiet({
|
||||
required int id,
|
||||
required Map<String, dynamic> body,
|
||||
}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
final _data = <String, dynamic>{};
|
||||
_data.addAll(body);
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/start',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cancelDiet({required int id}) async {
|
||||
final _extra = <String, dynamic>{};
|
||||
final queryParameters = <String, dynamic>{};
|
||||
final _headers = <String, dynamic>{};
|
||||
const Map<String, dynamic>? _data = null;
|
||||
final _options = _setStreamType<void>(
|
||||
Options(method: 'POST', headers: _headers, extra: _extra)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/diets/${id}/cancel',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
|
||||
);
|
||||
await _dio.fetch<void>(_options);
|
||||
}
|
||||
|
||||
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
||||
if (T != dynamic &&
|
||||
!(requestOptions.responseType == ResponseType.bytes ||
|
||||
requestOptions.responseType == ResponseType.stream)) {
|
||||
if (T == String) {
|
||||
requestOptions.responseType = ResponseType.plain;
|
||||
} else {
|
||||
requestOptions.responseType = ResponseType.json;
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
|
||||
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
|
||||
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
||||
return dioBaseUrl;
|
||||
}
|
||||
|
||||
final url = Uri.parse(baseUrl);
|
||||
|
||||
if (url.isAbsolute) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,543 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'comment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
CommentModel _$CommentModelFromJson(Map<String, dynamic> json) {
|
||||
return _CommentModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CommentModel {
|
||||
@JsonKey(name: "data")
|
||||
List<Comment> get data => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "links")
|
||||
Links get links => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "meta")
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CommentModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CommentModelCopyWith<CommentModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CommentModelCopyWith<$Res> {
|
||||
factory $CommentModelCopyWith(
|
||||
CommentModel value, $Res Function(CommentModel) then) =
|
||||
_$CommentModelCopyWithImpl<$Res, CommentModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "data") List<Comment> data,
|
||||
@JsonKey(name: "links") Links links,
|
||||
@JsonKey(name: "meta") Meta meta});
|
||||
|
||||
$LinksCopyWith<$Res> get links;
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel>
|
||||
implements $CommentModelCopyWith<$Res> {
|
||||
_$CommentModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// 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<Comment>,
|
||||
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 CommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LinksCopyWith<$Res> get links {
|
||||
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||
return _then(_value.copyWith(links: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentModelImplCopyWith<$Res>
|
||||
implements $CommentModelCopyWith<$Res> {
|
||||
factory _$$CommentModelImplCopyWith(
|
||||
_$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) =
|
||||
__$$CommentModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "data") List<Comment> data,
|
||||
@JsonKey(name: "links") Links links,
|
||||
@JsonKey(name: "meta") Meta meta});
|
||||
|
||||
@override
|
||||
$LinksCopyWith<$Res> get links;
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentModelImplCopyWithImpl<$Res>
|
||||
extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl>
|
||||
implements _$$CommentModelImplCopyWith<$Res> {
|
||||
__$$CommentModelImplCopyWithImpl(
|
||||
_$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// 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(_$CommentModelImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<Comment>,
|
||||
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 _$CommentModelImpl implements _CommentModel {
|
||||
const _$CommentModelImpl(
|
||||
{@JsonKey(name: "data") required final List<Comment> data,
|
||||
@JsonKey(name: "links") required this.links,
|
||||
@JsonKey(name: "meta") required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$CommentModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CommentModelImplFromJson(json);
|
||||
|
||||
final List<Comment> _data;
|
||||
@override
|
||||
@JsonKey(name: "data")
|
||||
List<Comment> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
final Links links;
|
||||
@override
|
||||
@JsonKey(name: "meta")
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CommentModel(data: $data, links: $links, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CommentModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.links, links) || other.links == links) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith =>
|
||||
__$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CommentModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _CommentModel implements CommentModel {
|
||||
const factory _CommentModel(
|
||||
{@JsonKey(name: "data") required final List<Comment> data,
|
||||
@JsonKey(name: "links") required final Links links,
|
||||
@JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl;
|
||||
|
||||
factory _CommentModel.fromJson(Map<String, dynamic> json) =
|
||||
_$CommentModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "data")
|
||||
List<Comment> get data;
|
||||
@override
|
||||
@JsonKey(name: "links")
|
||||
Links get links;
|
||||
@override
|
||||
@JsonKey(name: "meta")
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of CommentModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Comment _$CommentFromJson(Map<String, dynamic> json) {
|
||||
return _Comment.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Comment {
|
||||
@JsonKey(name: "id")
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "author_name")
|
||||
String get authorName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
String get authorProfileIcon => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "body")
|
||||
String get body => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "children_comments")
|
||||
List<Comment> get childrenComments => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Comment to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Comment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$CommentCopyWith<Comment> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $CommentCopyWith<$Res> {
|
||||
factory $CommentCopyWith(Comment value, $Res Function(Comment) then) =
|
||||
_$CommentCopyWithImpl<$Res, Comment>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "author_name") String authorName,
|
||||
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
|
||||
@JsonKey(name: "body") String body,
|
||||
@JsonKey(name: "children_comments") List<Comment> childrenComments,
|
||||
@JsonKey(name: "created_at") DateTime createdAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$CommentCopyWithImpl<$Res, $Val extends Comment>
|
||||
implements $CommentCopyWith<$Res> {
|
||||
_$CommentCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Comment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? authorName = null,
|
||||
Object? authorProfileIcon = null,
|
||||
Object? body = null,
|
||||
Object? childrenComments = null,
|
||||
Object? createdAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
authorName: null == authorName
|
||||
? _value.authorName
|
||||
: authorName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authorProfileIcon: null == authorProfileIcon
|
||||
? _value.authorProfileIcon
|
||||
: authorProfileIcon // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
body: null == body
|
||||
? _value.body
|
||||
: body // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
childrenComments: null == childrenComments
|
||||
? _value.childrenComments
|
||||
: childrenComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<Comment>,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> {
|
||||
factory _$$CommentImplCopyWith(
|
||||
_$CommentImpl value, $Res Function(_$CommentImpl) then) =
|
||||
__$$CommentImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: "id") int id,
|
||||
@JsonKey(name: "author_name") String authorName,
|
||||
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
|
||||
@JsonKey(name: "body") String body,
|
||||
@JsonKey(name: "children_comments") List<Comment> childrenComments,
|
||||
@JsonKey(name: "created_at") DateTime createdAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$CommentImplCopyWithImpl<$Res>
|
||||
extends _$CommentCopyWithImpl<$Res, _$CommentImpl>
|
||||
implements _$$CommentImplCopyWith<$Res> {
|
||||
__$$CommentImplCopyWithImpl(
|
||||
_$CommentImpl _value, $Res Function(_$CommentImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Comment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? authorName = null,
|
||||
Object? authorProfileIcon = null,
|
||||
Object? body = null,
|
||||
Object? childrenComments = null,
|
||||
Object? createdAt = null,
|
||||
}) {
|
||||
return _then(_$CommentImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
authorName: null == authorName
|
||||
? _value.authorName
|
||||
: authorName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authorProfileIcon: null == authorProfileIcon
|
||||
? _value.authorProfileIcon
|
||||
: authorProfileIcon // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
body: null == body
|
||||
? _value.body
|
||||
: body // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
childrenComments: null == childrenComments
|
||||
? _value._childrenComments
|
||||
: childrenComments // ignore: cast_nullable_to_non_nullable
|
||||
as List<Comment>,
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$CommentImpl implements _Comment {
|
||||
const _$CommentImpl(
|
||||
{@JsonKey(name: "id") required this.id,
|
||||
@JsonKey(name: "author_name") required this.authorName,
|
||||
@JsonKey(name: "author_profile_icon") required this.authorProfileIcon,
|
||||
@JsonKey(name: "body") required this.body,
|
||||
@JsonKey(name: "children_comments")
|
||||
required final List<Comment> childrenComments,
|
||||
@JsonKey(name: "created_at") required this.createdAt})
|
||||
: _childrenComments = childrenComments;
|
||||
|
||||
factory _$CommentImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$CommentImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: "author_name")
|
||||
final String authorName;
|
||||
@override
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
final String authorProfileIcon;
|
||||
@override
|
||||
@JsonKey(name: "body")
|
||||
final String body;
|
||||
final List<Comment> _childrenComments;
|
||||
@override
|
||||
@JsonKey(name: "children_comments")
|
||||
List<Comment> get childrenComments {
|
||||
if (_childrenComments is EqualUnmodifiableListView)
|
||||
return _childrenComments;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_childrenComments);
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
final DateTime createdAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Comment(id: $id, authorName: $authorName, authorProfileIcon: $authorProfileIcon, body: $body, childrenComments: $childrenComments, createdAt: $createdAt)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$CommentImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.authorName, authorName) ||
|
||||
other.authorName == authorName) &&
|
||||
(identical(other.authorProfileIcon, authorProfileIcon) ||
|
||||
other.authorProfileIcon == authorProfileIcon) &&
|
||||
(identical(other.body, body) || other.body == body) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._childrenComments, _childrenComments) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
authorName,
|
||||
authorProfileIcon,
|
||||
body,
|
||||
const DeepCollectionEquality().hash(_childrenComments),
|
||||
createdAt);
|
||||
|
||||
/// Create a copy of Comment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$CommentImplCopyWith<_$CommentImpl> get copyWith =>
|
||||
__$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$CommentImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Comment implements Comment {
|
||||
const factory _Comment(
|
||||
{@JsonKey(name: "id") required final int id,
|
||||
@JsonKey(name: "author_name") required final String authorName,
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
required final String authorProfileIcon,
|
||||
@JsonKey(name: "body") required final String body,
|
||||
@JsonKey(name: "children_comments")
|
||||
required final List<Comment> childrenComments,
|
||||
@JsonKey(name: "created_at") required final DateTime createdAt}) =
|
||||
_$CommentImpl;
|
||||
|
||||
factory _Comment.fromJson(Map<String, dynamic> json) = _$CommentImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: "id")
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: "author_name")
|
||||
String get authorName;
|
||||
@override
|
||||
@JsonKey(name: "author_profile_icon")
|
||||
String get authorProfileIcon;
|
||||
@override
|
||||
@JsonKey(name: "body")
|
||||
String get body;
|
||||
@override
|
||||
@JsonKey(name: "children_comments")
|
||||
List<Comment> get childrenComments;
|
||||
@override
|
||||
@JsonKey(name: "created_at")
|
||||
DateTime get createdAt;
|
||||
|
||||
/// Create a copy of Comment
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$CommentImplCopyWith<_$CommentImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'comment_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$CommentModelImpl _$$CommentModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CommentModelImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) => Comment.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>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CommentModelImplToJson(_$CommentModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$CommentImpl _$$CommentImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CommentImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
authorName: json['author_name'] as String,
|
||||
authorProfileIcon: json['author_profile_icon'] as String,
|
||||
body: json['body'] as String,
|
||||
childrenComments: (json['children_comments'] as List<dynamic>)
|
||||
.map((e) => Comment.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CommentImplToJson(_$CommentImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'author_name': instance.authorName,
|
||||
'author_profile_icon': instance.authorProfileIcon,
|
||||
'body': instance.body,
|
||||
'children_comments': instance.childrenComments,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,171 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'diets_pagination_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$DietsPaginationImpl _$$DietsPaginationImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$DietsPaginationImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) => Diet.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>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DietsPaginationImplToJson(
|
||||
_$DietsPaginationImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$DietImpl _$$DietImplFromJson(Map<String, dynamic> json) => _$DietImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
image: json['image'] as String,
|
||||
duration: (json['duration'] as num).toInt(),
|
||||
state: $enumDecode(_$DietStateEnumMap, json['state']),
|
||||
type: DietType.fromJson(json['type'] as Map<String, dynamic>),
|
||||
details: json['description_md'] as String,
|
||||
dailySchedule: (json['daily_schedule'] as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
int.parse(k),
|
||||
(e as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
int.parse(k),
|
||||
(e as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(int.parse(k),
|
||||
DailySchedule.fromJson(e as Map<String, dynamic>)),
|
||||
)),
|
||||
)),
|
||||
),
|
||||
author: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||
totalLikes: (json['total_likes'] as num).toInt(),
|
||||
totalViews: (json['total_views'] as num).toInt(),
|
||||
totalComments: (json['total_comments'] as num).toInt(),
|
||||
wasLikedByMe: json['was_liked_by_me'] as bool,
|
||||
isFavorite: json['is_favorite'] as bool,
|
||||
dailyNutrition: (json['daily_nutrition'] as List<dynamic>)
|
||||
.map((e) => DailyNutrition.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DietImplToJson(_$DietImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'image': instance.image,
|
||||
'duration': instance.duration,
|
||||
'state': _$DietStateEnumMap[instance.state]!,
|
||||
'type': instance.type,
|
||||
'description_md': instance.details,
|
||||
'daily_schedule': instance.dailySchedule.map((k, e) => MapEntry(
|
||||
k.toString(),
|
||||
e.map((k, e) => MapEntry(
|
||||
k.toString(), e.map((k, e) => MapEntry(k.toString(), e)))))),
|
||||
'author': instance.author,
|
||||
'total_likes': instance.totalLikes,
|
||||
'total_views': instance.totalViews,
|
||||
'total_comments': instance.totalComments,
|
||||
'was_liked_by_me': instance.wasLikedByMe,
|
||||
'is_favorite': instance.isFavorite,
|
||||
'daily_nutrition': instance.dailyNutrition,
|
||||
};
|
||||
|
||||
const _$DietStateEnumMap = {
|
||||
DietState.active: 'active',
|
||||
DietState.draft: 'draft',
|
||||
DietState.personal: 'personal',
|
||||
};
|
||||
|
||||
_$CreatedDietImpl _$$CreatedDietImplFromJson(Map<String, dynamic> json) =>
|
||||
_$CreatedDietImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$CreatedDietImplToJson(_$CreatedDietImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
||||
|
||||
_$AuthorImpl _$$AuthorImplFromJson(Map<String, dynamic> json) => _$AuthorImpl(
|
||||
authorSlug: json['author_slug'] as String,
|
||||
authorName: json['author_name'] as String,
|
||||
authorProfileIcon: json['author_profile_icon'] as String,
|
||||
authorIsMe: json['author_is_me'] as bool,
|
||||
isEntitySubscribedByMe: json['is_entity_subscribed_by_me'] as bool?,
|
||||
authorPlaceInRating: (json['author_place_in_rating'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$AuthorImplToJson(_$AuthorImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'author_slug': instance.authorSlug,
|
||||
'author_name': instance.authorName,
|
||||
'author_profile_icon': instance.authorProfileIcon,
|
||||
'author_is_me': instance.authorIsMe,
|
||||
'is_entity_subscribed_by_me': instance.isEntitySubscribedByMe,
|
||||
'author_place_in_rating': instance.authorPlaceInRating,
|
||||
};
|
||||
|
||||
_$DailyScheduleImpl _$$DailyScheduleImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DailyScheduleImpl(
|
||||
name: json['name'] as String,
|
||||
portion: $enumDecode(_$PortionEnumMap, json['portion']),
|
||||
quantity: _parseQuantity(json['quantity']),
|
||||
dailyNutrition: json['nutrition'] == null
|
||||
? null
|
||||
: DailyNutrition.fromJson(json['nutrition'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DailyScheduleImplToJson(_$DailyScheduleImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'portion': _$PortionEnumMap[instance.portion]!,
|
||||
'quantity': instance.quantity,
|
||||
if (instance.productNutritionalValueId case final value?)
|
||||
'product_nutritional_value_id': value,
|
||||
};
|
||||
|
||||
const _$PortionEnumMap = {
|
||||
Portion.grams: 'gr',
|
||||
Portion.milliliters: 'milliliters',
|
||||
Portion.pcs: 'pcs',
|
||||
};
|
||||
|
||||
_$DietTypeImpl _$$DietTypeImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DietTypeImpl(
|
||||
light: json['light'] as bool?,
|
||||
veg: json['veg'] as bool?,
|
||||
carb: json['carb'] as bool?,
|
||||
meat: json['meat'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DietTypeImplToJson(_$DietTypeImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'light': instance.light,
|
||||
'veg': instance.veg,
|
||||
'carb': instance.carb,
|
||||
'meat': instance.meat,
|
||||
};
|
||||
|
||||
_$DailyNutritionImpl _$$DailyNutritionImplFromJson(Map<String, dynamic> json) =>
|
||||
_$DailyNutritionImpl(
|
||||
energy: (json['energy'] as num).toDouble(),
|
||||
proteins: (json['proteins'] as num).toDouble(),
|
||||
fats: (json['fats'] as num).toDouble(),
|
||||
carbohydrates: (json['carbohydrates'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$DailyNutritionImplToJson(
|
||||
_$DailyNutritionImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'energy': instance.energy,
|
||||
'proteins': instance.proteins,
|
||||
'fats': instance.fats,
|
||||
'carbohydrates': instance.carbohydrates,
|
||||
};
|
||||
@@ -1,470 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'feed_blog_post_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
FeedBlogPostModel _$FeedBlogPostModelFromJson(Map<String, dynamic> json) {
|
||||
return _FeedBlogPostModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedBlogPostModel {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
Author get author => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "video_url")
|
||||
String get videoUrl => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "created_at", fromJson: parseDate)
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate)
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total_likes")
|
||||
int get totalLikes => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total_views")
|
||||
int get totalViews => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "total_comments")
|
||||
int get totalComments => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "was_liked_by_me")
|
||||
bool get wasLikedByMe => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedBlogPostModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedBlogPostModelCopyWith<FeedBlogPostModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedBlogPostModelCopyWith<$Res> {
|
||||
factory $FeedBlogPostModelCopyWith(
|
||||
FeedBlogPostModel value, $Res Function(FeedBlogPostModel) then) =
|
||||
_$FeedBlogPostModelCopyWithImpl<$Res, FeedBlogPostModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String state,
|
||||
String image,
|
||||
String description,
|
||||
Author author,
|
||||
@JsonKey(name: "video_url") String videoUrl,
|
||||
@JsonKey(name: "created_at", fromJson: parseDate) DateTime createdAt,
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate) DateTime updatedAt,
|
||||
String title,
|
||||
@JsonKey(name: "total_likes") int totalLikes,
|
||||
@JsonKey(name: "total_views") int totalViews,
|
||||
@JsonKey(name: "total_comments") int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") bool wasLikedByMe});
|
||||
|
||||
$AuthorCopyWith<$Res> get author;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel>
|
||||
implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
_$FeedBlogPostModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? state = null,
|
||||
Object? image = null,
|
||||
Object? description = null,
|
||||
Object? author = null,
|
||||
Object? videoUrl = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? title = null,
|
||||
Object? totalLikes = null,
|
||||
Object? totalViews = null,
|
||||
Object? totalComments = null,
|
||||
Object? wasLikedByMe = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
image: null == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
author: null == author
|
||||
? _value.author
|
||||
: author // ignore: cast_nullable_to_non_nullable
|
||||
as Author,
|
||||
videoUrl: null == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
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,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
totalLikes: null == totalLikes
|
||||
? _value.totalLikes
|
||||
: totalLikes // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalViews: null == totalViews
|
||||
? _value.totalViews
|
||||
: totalViews // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalComments: null == totalComments
|
||||
? _value.totalComments
|
||||
: totalComments // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
wasLikedByMe: null == wasLikedByMe
|
||||
? _value.wasLikedByMe
|
||||
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AuthorCopyWith<$Res> get author {
|
||||
return $AuthorCopyWith<$Res>(_value.author, (value) {
|
||||
return _then(_value.copyWith(author: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedBlogPostModelImplCopyWith<$Res>
|
||||
implements $FeedBlogPostModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostModelImplCopyWith(_$FeedBlogPostModelImpl value,
|
||||
$Res Function(_$FeedBlogPostModelImpl) then) =
|
||||
__$$FeedBlogPostModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
String state,
|
||||
String image,
|
||||
String description,
|
||||
Author author,
|
||||
@JsonKey(name: "video_url") String videoUrl,
|
||||
@JsonKey(name: "created_at", fromJson: parseDate) DateTime createdAt,
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate) DateTime updatedAt,
|
||||
String title,
|
||||
@JsonKey(name: "total_likes") int totalLikes,
|
||||
@JsonKey(name: "total_views") int totalViews,
|
||||
@JsonKey(name: "total_comments") int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") bool wasLikedByMe});
|
||||
|
||||
@override
|
||||
$AuthorCopyWith<$Res> get author;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedBlogPostModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedBlogPostModelCopyWithImpl<$Res, _$FeedBlogPostModelImpl>
|
||||
implements _$$FeedBlogPostModelImplCopyWith<$Res> {
|
||||
__$$FeedBlogPostModelImplCopyWithImpl(_$FeedBlogPostModelImpl _value,
|
||||
$Res Function(_$FeedBlogPostModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? state = null,
|
||||
Object? image = null,
|
||||
Object? description = null,
|
||||
Object? author = null,
|
||||
Object? videoUrl = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? title = null,
|
||||
Object? totalLikes = null,
|
||||
Object? totalViews = null,
|
||||
Object? totalComments = null,
|
||||
Object? wasLikedByMe = null,
|
||||
}) {
|
||||
return _then(_$FeedBlogPostModelImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
state: null == state
|
||||
? _value.state
|
||||
: state // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
image: null == image
|
||||
? _value.image
|
||||
: image // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
author: null == author
|
||||
? _value.author
|
||||
: author // ignore: cast_nullable_to_non_nullable
|
||||
as Author,
|
||||
videoUrl: null == videoUrl
|
||||
? _value.videoUrl
|
||||
: videoUrl // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
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,
|
||||
title: null == title
|
||||
? _value.title
|
||||
: title // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
totalLikes: null == totalLikes
|
||||
? _value.totalLikes
|
||||
: totalLikes // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalViews: null == totalViews
|
||||
? _value.totalViews
|
||||
: totalViews // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
totalComments: null == totalComments
|
||||
? _value.totalComments
|
||||
: totalComments // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
wasLikedByMe: null == wasLikedByMe
|
||||
? _value.wasLikedByMe
|
||||
: wasLikedByMe // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedBlogPostModelImpl implements _FeedBlogPostModel {
|
||||
const _$FeedBlogPostModelImpl(
|
||||
{required this.id,
|
||||
required this.state,
|
||||
required this.image,
|
||||
required this.description,
|
||||
required this.author,
|
||||
@JsonKey(name: "video_url") required this.videoUrl,
|
||||
@JsonKey(name: "created_at", fromJson: parseDate) required this.createdAt,
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate) required this.updatedAt,
|
||||
required this.title,
|
||||
@JsonKey(name: "total_likes") required this.totalLikes,
|
||||
@JsonKey(name: "total_views") required this.totalViews,
|
||||
@JsonKey(name: "total_comments") required this.totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") required this.wasLikedByMe});
|
||||
|
||||
factory _$FeedBlogPostModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedBlogPostModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String state;
|
||||
@override
|
||||
final String image;
|
||||
@override
|
||||
final String description;
|
||||
@override
|
||||
final Author author;
|
||||
@override
|
||||
@JsonKey(name: "video_url")
|
||||
final String videoUrl;
|
||||
@override
|
||||
@JsonKey(name: "created_at", fromJson: parseDate)
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate)
|
||||
final DateTime updatedAt;
|
||||
@override
|
||||
final String title;
|
||||
@override
|
||||
@JsonKey(name: "total_likes")
|
||||
final int totalLikes;
|
||||
@override
|
||||
@JsonKey(name: "total_views")
|
||||
final int totalViews;
|
||||
@override
|
||||
@JsonKey(name: "total_comments")
|
||||
final int totalComments;
|
||||
@override
|
||||
@JsonKey(name: "was_liked_by_me")
|
||||
final bool wasLikedByMe;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedBlogPostModel(id: $id, state: $state, image: $image, description: $description, author: $author, videoUrl: $videoUrl, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, totalLikes: $totalLikes, totalViews: $totalViews, totalComments: $totalComments, wasLikedByMe: $wasLikedByMe)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedBlogPostModelImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.state, state) || other.state == state) &&
|
||||
(identical(other.image, image) || other.image == image) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.author, author) || other.author == author) &&
|
||||
(identical(other.videoUrl, videoUrl) ||
|
||||
other.videoUrl == videoUrl) &&
|
||||
(identical(other.createdAt, createdAt) ||
|
||||
other.createdAt == createdAt) &&
|
||||
(identical(other.updatedAt, updatedAt) ||
|
||||
other.updatedAt == updatedAt) &&
|
||||
(identical(other.title, title) || other.title == title) &&
|
||||
(identical(other.totalLikes, totalLikes) ||
|
||||
other.totalLikes == totalLikes) &&
|
||||
(identical(other.totalViews, totalViews) ||
|
||||
other.totalViews == totalViews) &&
|
||||
(identical(other.totalComments, totalComments) ||
|
||||
other.totalComments == totalComments) &&
|
||||
(identical(other.wasLikedByMe, wasLikedByMe) ||
|
||||
other.wasLikedByMe == wasLikedByMe));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
id,
|
||||
state,
|
||||
image,
|
||||
description,
|
||||
author,
|
||||
videoUrl,
|
||||
createdAt,
|
||||
updatedAt,
|
||||
title,
|
||||
totalLikes,
|
||||
totalViews,
|
||||
totalComments,
|
||||
wasLikedByMe);
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith =>
|
||||
__$$FeedBlogPostModelImplCopyWithImpl<_$FeedBlogPostModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedBlogPostModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedBlogPostModel implements FeedBlogPostModel {
|
||||
const factory _FeedBlogPostModel(
|
||||
{required final int id,
|
||||
required final String state,
|
||||
required final String image,
|
||||
required final String description,
|
||||
required final Author author,
|
||||
@JsonKey(name: "video_url") required final String videoUrl,
|
||||
@JsonKey(name: "created_at", fromJson: parseDate)
|
||||
required final DateTime createdAt,
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate)
|
||||
required final DateTime updatedAt,
|
||||
required final String title,
|
||||
@JsonKey(name: "total_likes") required final int totalLikes,
|
||||
@JsonKey(name: "total_views") required final int totalViews,
|
||||
@JsonKey(name: "total_comments") required final int totalComments,
|
||||
@JsonKey(name: "was_liked_by_me") required final bool wasLikedByMe}) =
|
||||
_$FeedBlogPostModelImpl;
|
||||
|
||||
factory _FeedBlogPostModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedBlogPostModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get state;
|
||||
@override
|
||||
String get image;
|
||||
@override
|
||||
String get description;
|
||||
@override
|
||||
Author get author;
|
||||
@override
|
||||
@JsonKey(name: "video_url")
|
||||
String get videoUrl;
|
||||
@override
|
||||
@JsonKey(name: "created_at", fromJson: parseDate)
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: "updated_at", fromJson: parseDate)
|
||||
DateTime get updatedAt;
|
||||
@override
|
||||
String get title;
|
||||
@override
|
||||
@JsonKey(name: "total_likes")
|
||||
int get totalLikes;
|
||||
@override
|
||||
@JsonKey(name: "total_views")
|
||||
int get totalViews;
|
||||
@override
|
||||
@JsonKey(name: "total_comments")
|
||||
int get totalComments;
|
||||
@override
|
||||
@JsonKey(name: "was_liked_by_me")
|
||||
bool get wasLikedByMe;
|
||||
|
||||
/// Create a copy of FeedBlogPostModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'feed_blog_post_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedBlogPostModelImpl _$$FeedBlogPostModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedBlogPostModelImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
state: json['state'] as String,
|
||||
image: json['image'] as String,
|
||||
description: json['description'] as String,
|
||||
author: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||
videoUrl: json['video_url'] as String,
|
||||
createdAt: parseDate(json['created_at'] as String),
|
||||
updatedAt: parseDate(json['updated_at'] as String),
|
||||
title: json['title'] as String,
|
||||
totalLikes: (json['total_likes'] as num).toInt(),
|
||||
totalViews: (json['total_views'] as num).toInt(),
|
||||
totalComments: (json['total_comments'] as num).toInt(),
|
||||
wasLikedByMe: json['was_liked_by_me'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedBlogPostModelImplToJson(
|
||||
_$FeedBlogPostModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'state': instance.state,
|
||||
'image': instance.image,
|
||||
'description': instance.description,
|
||||
'author': instance.author,
|
||||
'video_url': instance.videoUrl,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'updated_at': instance.updatedAt.toIso8601String(),
|
||||
'title': instance.title,
|
||||
'total_likes': instance.totalLikes,
|
||||
'total_views': instance.totalViews,
|
||||
'total_comments': instance.totalComments,
|
||||
'was_liked_by_me': instance.wasLikedByMe,
|
||||
};
|
||||
@@ -1,225 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'feed_blog_post_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
FeedBlogPostSettingsModel _$FeedBlogPostSettingsModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _FeedBlogPostSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedBlogPostSettingsModel {
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList =>
|
||||
throw _privateConstructorUsedError;
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedBlogPostSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedBlogPostSettingsModelCopyWith<FeedBlogPostSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
factory $FeedBlogPostSettingsModelCopyWith(FeedBlogPostSettingsModel value,
|
||||
$Res Function(FeedBlogPostSettingsModel) then) =
|
||||
_$FeedBlogPostSettingsModelCopyWithImpl<$Res, FeedBlogPostSettingsModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<FeedBlogPostModel> feedBlogPostList,
|
||||
Meta meta});
|
||||
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedBlogPostSettingsModelCopyWithImpl<$Res,
|
||||
$Val extends FeedBlogPostSettingsModel>
|
||||
implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
_$FeedBlogPostSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? feedBlogPostList = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
feedBlogPostList: null == feedBlogPostList
|
||||
? _value.feedBlogPostList
|
||||
: feedBlogPostList // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedBlogPostModel>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedBlogPostSettingsModelImplCopyWith<$Res>
|
||||
implements $FeedBlogPostSettingsModelCopyWith<$Res> {
|
||||
factory _$$FeedBlogPostSettingsModelImplCopyWith(
|
||||
_$FeedBlogPostSettingsModelImpl value,
|
||||
$Res Function(_$FeedBlogPostSettingsModelImpl) then) =
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'data') List<FeedBlogPostModel> feedBlogPostList,
|
||||
Meta meta});
|
||||
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedBlogPostSettingsModelCopyWithImpl<$Res,
|
||||
_$FeedBlogPostSettingsModelImpl>
|
||||
implements _$$FeedBlogPostSettingsModelImplCopyWith<$Res> {
|
||||
__$$FeedBlogPostSettingsModelImplCopyWithImpl(
|
||||
_$FeedBlogPostSettingsModelImpl _value,
|
||||
$Res Function(_$FeedBlogPostSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? feedBlogPostList = null,
|
||||
Object? meta = null,
|
||||
}) {
|
||||
return _then(_$FeedBlogPostSettingsModelImpl(
|
||||
feedBlogPostList: null == feedBlogPostList
|
||||
? _value._feedBlogPostList
|
||||
: feedBlogPostList // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedBlogPostModel>,
|
||||
meta: null == meta
|
||||
? _value.meta
|
||||
: meta // ignore: cast_nullable_to_non_nullable
|
||||
as Meta,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel {
|
||||
const _$FeedBlogPostSettingsModelImpl(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<FeedBlogPostModel> feedBlogPostList,
|
||||
required this.meta})
|
||||
: _feedBlogPostList = feedBlogPostList;
|
||||
|
||||
factory _$FeedBlogPostSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedBlogPostSettingsModelImplFromJson(json);
|
||||
|
||||
final List<FeedBlogPostModel> _feedBlogPostList;
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList {
|
||||
if (_feedBlogPostList is EqualUnmodifiableListView)
|
||||
return _feedBlogPostList;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_feedBlogPostList);
|
||||
}
|
||||
|
||||
@override
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedBlogPostSettingsModel(feedBlogPostList: $feedBlogPostList, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedBlogPostSettingsModelImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._feedBlogPostList, _feedBlogPostList) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,
|
||||
const DeepCollectionEquality().hash(_feedBlogPostList), meta);
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl>
|
||||
get copyWith => __$$FeedBlogPostSettingsModelImplCopyWithImpl<
|
||||
_$FeedBlogPostSettingsModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedBlogPostSettingsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel {
|
||||
const factory _FeedBlogPostSettingsModel(
|
||||
{@JsonKey(name: 'data')
|
||||
required final List<FeedBlogPostModel> feedBlogPostList,
|
||||
required final Meta meta}) = _$FeedBlogPostSettingsModelImpl;
|
||||
|
||||
factory _FeedBlogPostSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedBlogPostSettingsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'data')
|
||||
List<FeedBlogPostModel> get feedBlogPostList;
|
||||
@override
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of FeedBlogPostSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'feed_blog_post_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedBlogPostSettingsModelImpl _$$FeedBlogPostSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedBlogPostSettingsModelImpl(
|
||||
feedBlogPostList: (json['data'] as List<dynamic>)
|
||||
.map((e) => FeedBlogPostModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
meta: Meta.fromJson(json['meta'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedBlogPostSettingsModelImplToJson(
|
||||
_$FeedBlogPostSettingsModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.feedBlogPostList,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
@@ -1,554 +0,0 @@
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'feed_consultant_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
FeedConsultantPaginationModel _$FeedConsultantPaginationModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _FeedConsultantPaginationModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedConsultantPaginationModel {
|
||||
List<FeedConsultantModel> get data => throw _privateConstructorUsedError;
|
||||
Links get links => throw _privateConstructorUsedError;
|
||||
Meta get meta => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedConsultantPaginationModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedConsultantPaginationModelCopyWith<FeedConsultantPaginationModel>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
factory $FeedConsultantPaginationModelCopyWith(
|
||||
FeedConsultantPaginationModel value,
|
||||
$Res Function(FeedConsultantPaginationModel) then) =
|
||||
_$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
FeedConsultantPaginationModel>;
|
||||
@useResult
|
||||
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||
|
||||
$LinksCopyWith<$Res> get links;
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
$Val extends FeedConsultantPaginationModel>
|
||||
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
_$FeedConsultantPaginationModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// 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<FeedConsultantModel>,
|
||||
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 FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LinksCopyWith<$Res> get links {
|
||||
return $LinksCopyWith<$Res>(_value.links, (value) {
|
||||
return _then(_value.copyWith(links: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$MetaCopyWith<$Res> get meta {
|
||||
return $MetaCopyWith<$Res>(_value.meta, (value) {
|
||||
return _then(_value.copyWith(meta: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedConsultantPaginationModelImplCopyWith<$Res>
|
||||
implements $FeedConsultantPaginationModelCopyWith<$Res> {
|
||||
factory _$$FeedConsultantPaginationModelImplCopyWith(
|
||||
_$FeedConsultantPaginationModelImpl value,
|
||||
$Res Function(_$FeedConsultantPaginationModelImpl) then) =
|
||||
__$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<FeedConsultantModel> data, Links links, Meta meta});
|
||||
|
||||
@override
|
||||
$LinksCopyWith<$Res> get links;
|
||||
@override
|
||||
$MetaCopyWith<$Res> get meta;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedConsultantPaginationModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedConsultantPaginationModelCopyWithImpl<$Res,
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
implements _$$FeedConsultantPaginationModelImplCopyWith<$Res> {
|
||||
__$$FeedConsultantPaginationModelImplCopyWithImpl(
|
||||
_$FeedConsultantPaginationModelImpl _value,
|
||||
$Res Function(_$FeedConsultantPaginationModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// 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(_$FeedConsultantPaginationModelImpl(
|
||||
data: null == data
|
||||
? _value._data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as List<FeedConsultantModel>,
|
||||
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 _$FeedConsultantPaginationModelImpl
|
||||
implements _FeedConsultantPaginationModel {
|
||||
const _$FeedConsultantPaginationModelImpl(
|
||||
{required final List<FeedConsultantModel> data,
|
||||
required this.links,
|
||||
required this.meta})
|
||||
: _data = data;
|
||||
|
||||
factory _$FeedConsultantPaginationModelImpl.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$$FeedConsultantPaginationModelImplFromJson(json);
|
||||
|
||||
final List<FeedConsultantModel> _data;
|
||||
@override
|
||||
List<FeedConsultantModel> get data {
|
||||
if (_data is EqualUnmodifiableListView) return _data;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_data);
|
||||
}
|
||||
|
||||
@override
|
||||
final Links links;
|
||||
@override
|
||||
final Meta meta;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedConsultantPaginationModel(data: $data, links: $links, meta: $meta)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedConsultantPaginationModelImpl &&
|
||||
const DeepCollectionEquality().equals(other._data, _data) &&
|
||||
(identical(other.links, links) || other.links == links) &&
|
||||
(identical(other.meta, meta) || other.meta == meta));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
get copyWith => __$$FeedConsultantPaginationModelImplCopyWithImpl<
|
||||
_$FeedConsultantPaginationModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedConsultantPaginationModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedConsultantPaginationModel
|
||||
implements FeedConsultantPaginationModel {
|
||||
const factory _FeedConsultantPaginationModel(
|
||||
{required final List<FeedConsultantModel> data,
|
||||
required final Links links,
|
||||
required final Meta meta}) = _$FeedConsultantPaginationModelImpl;
|
||||
|
||||
factory _FeedConsultantPaginationModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedConsultantPaginationModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<FeedConsultantModel> get data;
|
||||
@override
|
||||
Links get links;
|
||||
@override
|
||||
Meta get meta;
|
||||
|
||||
/// Create a copy of FeedConsultantPaginationModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedConsultantPaginationModelImplCopyWith<
|
||||
_$FeedConsultantPaginationModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
FeedConsultantModel _$FeedConsultantModelFromJson(Map<String, dynamic> json) {
|
||||
return _FeedConsultantModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$FeedConsultantModel {
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'additional_info')
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'rating_place')
|
||||
int? get ratingPlace => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'total_scores')
|
||||
int get totalScores => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get photo => throw _privateConstructorUsedError;
|
||||
List<BadgeModel> get badges => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this FeedConsultantModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$FeedConsultantModelCopyWith<FeedConsultantModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $FeedConsultantModelCopyWith<$Res> {
|
||||
factory $FeedConsultantModelCopyWith(
|
||||
FeedConsultantModel value, $Res Function(FeedConsultantModel) then) =
|
||||
_$FeedConsultantModelCopyWithImpl<$Res, FeedConsultantModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String slug,
|
||||
String name,
|
||||
@JsonKey(name: 'additional_info') String description,
|
||||
@JsonKey(name: 'rating_place') int? ratingPlace,
|
||||
@JsonKey(name: 'total_scores') int totalScores,
|
||||
@JsonKey(name: 'profile_photo_url') String photo,
|
||||
List<BadgeModel> badges});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$FeedConsultantModelCopyWithImpl<$Res, $Val extends FeedConsultantModel>
|
||||
implements $FeedConsultantModelCopyWith<$Res> {
|
||||
_$FeedConsultantModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? ratingPlace = freezed,
|
||||
Object? totalScores = null,
|
||||
Object? photo = null,
|
||||
Object? badges = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
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,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
ratingPlace: freezed == ratingPlace
|
||||
? _value.ratingPlace
|
||||
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalScores: null == totalScores
|
||||
? _value.totalScores
|
||||
: totalScores // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
photo: null == photo
|
||||
? _value.photo
|
||||
: photo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
badges: null == badges
|
||||
? _value.badges
|
||||
: badges // ignore: cast_nullable_to_non_nullable
|
||||
as List<BadgeModel>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$FeedConsultantModelImplCopyWith<$Res>
|
||||
implements $FeedConsultantModelCopyWith<$Res> {
|
||||
factory _$$FeedConsultantModelImplCopyWith(_$FeedConsultantModelImpl value,
|
||||
$Res Function(_$FeedConsultantModelImpl) then) =
|
||||
__$$FeedConsultantModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String slug,
|
||||
String name,
|
||||
@JsonKey(name: 'additional_info') String description,
|
||||
@JsonKey(name: 'rating_place') int? ratingPlace,
|
||||
@JsonKey(name: 'total_scores') int totalScores,
|
||||
@JsonKey(name: 'profile_photo_url') String photo,
|
||||
List<BadgeModel> badges});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$FeedConsultantModelImplCopyWithImpl<$Res>
|
||||
extends _$FeedConsultantModelCopyWithImpl<$Res, _$FeedConsultantModelImpl>
|
||||
implements _$$FeedConsultantModelImplCopyWith<$Res> {
|
||||
__$$FeedConsultantModelImplCopyWithImpl(_$FeedConsultantModelImpl _value,
|
||||
$Res Function(_$FeedConsultantModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? slug = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? ratingPlace = freezed,
|
||||
Object? totalScores = null,
|
||||
Object? photo = null,
|
||||
Object? badges = null,
|
||||
}) {
|
||||
return _then(_$FeedConsultantModelImpl(
|
||||
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,
|
||||
description: null == description
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
ratingPlace: freezed == ratingPlace
|
||||
? _value.ratingPlace
|
||||
: ratingPlace // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
totalScores: null == totalScores
|
||||
? _value.totalScores
|
||||
: totalScores // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
photo: null == photo
|
||||
? _value.photo
|
||||
: photo // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
badges: null == badges
|
||||
? _value._badges
|
||||
: badges // ignore: cast_nullable_to_non_nullable
|
||||
as List<BadgeModel>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$FeedConsultantModelImpl implements _FeedConsultantModel {
|
||||
const _$FeedConsultantModelImpl(
|
||||
{required this.slug,
|
||||
required this.name,
|
||||
@JsonKey(name: 'additional_info') required this.description,
|
||||
@JsonKey(name: 'rating_place') this.ratingPlace,
|
||||
@JsonKey(name: 'total_scores') required this.totalScores,
|
||||
@JsonKey(name: 'profile_photo_url') required this.photo,
|
||||
required final List<BadgeModel> badges})
|
||||
: _badges = badges;
|
||||
|
||||
factory _$FeedConsultantModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$FeedConsultantModelImplFromJson(json);
|
||||
|
||||
@override
|
||||
final String slug;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
@JsonKey(name: 'additional_info')
|
||||
final String description;
|
||||
@override
|
||||
@JsonKey(name: 'rating_place')
|
||||
final int? ratingPlace;
|
||||
@override
|
||||
@JsonKey(name: 'total_scores')
|
||||
final int totalScores;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
final String photo;
|
||||
final List<BadgeModel> _badges;
|
||||
@override
|
||||
List<BadgeModel> get badges {
|
||||
if (_badges is EqualUnmodifiableListView) return _badges;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_badges);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FeedConsultantModel(slug: $slug, name: $name, description: $description, ratingPlace: $ratingPlace, totalScores: $totalScores, photo: $photo, badges: $badges)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$FeedConsultantModelImpl &&
|
||||
(identical(other.slug, slug) || other.slug == slug) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.ratingPlace, ratingPlace) ||
|
||||
other.ratingPlace == ratingPlace) &&
|
||||
(identical(other.totalScores, totalScores) ||
|
||||
other.totalScores == totalScores) &&
|
||||
(identical(other.photo, photo) || other.photo == photo) &&
|
||||
const DeepCollectionEquality().equals(other._badges, _badges));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
slug,
|
||||
name,
|
||||
description,
|
||||
ratingPlace,
|
||||
totalScores,
|
||||
photo,
|
||||
const DeepCollectionEquality().hash(_badges));
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||
__$$FeedConsultantModelImplCopyWithImpl<_$FeedConsultantModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$FeedConsultantModelImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _FeedConsultantModel implements FeedConsultantModel {
|
||||
const factory _FeedConsultantModel(
|
||||
{required final String slug,
|
||||
required final String name,
|
||||
@JsonKey(name: 'additional_info') required final String description,
|
||||
@JsonKey(name: 'rating_place') final int? ratingPlace,
|
||||
@JsonKey(name: 'total_scores') required final int totalScores,
|
||||
@JsonKey(name: 'profile_photo_url') required final String photo,
|
||||
required final List<BadgeModel> badges}) = _$FeedConsultantModelImpl;
|
||||
|
||||
factory _FeedConsultantModel.fromJson(Map<String, dynamic> json) =
|
||||
_$FeedConsultantModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get slug;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
@JsonKey(name: 'additional_info')
|
||||
String get description;
|
||||
@override
|
||||
@JsonKey(name: 'rating_place')
|
||||
int? get ratingPlace;
|
||||
@override
|
||||
@JsonKey(name: 'total_scores')
|
||||
int get totalScores;
|
||||
@override
|
||||
@JsonKey(name: 'profile_photo_url')
|
||||
String get photo;
|
||||
@override
|
||||
List<BadgeModel> get badges;
|
||||
|
||||
/// Create a copy of FeedConsultantModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$FeedConsultantModelImplCopyWith<_$FeedConsultantModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'feed_consultant_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$FeedConsultantPaginationModelImpl
|
||||
_$$FeedConsultantPaginationModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$FeedConsultantPaginationModelImpl(
|
||||
data: (json['data'] as List<dynamic>)
|
||||
.map((e) =>
|
||||
FeedConsultantModel.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>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedConsultantPaginationModelImplToJson(
|
||||
_$FeedConsultantPaginationModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data,
|
||||
'links': instance.links,
|
||||
'meta': instance.meta,
|
||||
};
|
||||
|
||||
_$FeedConsultantModelImpl _$$FeedConsultantModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$FeedConsultantModelImpl(
|
||||
slug: json['slug'] as String,
|
||||
name: json['name'] as String,
|
||||
description: json['additional_info'] as String,
|
||||
ratingPlace: (json['rating_place'] as num?)?.toInt(),
|
||||
totalScores: (json['total_scores'] as num).toInt(),
|
||||
photo: json['profile_photo_url'] as String,
|
||||
badges: (json['badges'] as List<dynamic>)
|
||||
.map((e) => BadgeModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FeedConsultantModelImplToJson(
|
||||
_$FeedConsultantModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'slug': instance.slug,
|
||||
'name': instance.name,
|
||||
'additional_info': instance.description,
|
||||
'rating_place': instance.ratingPlace,
|
||||
'total_scores': instance.totalScores,
|
||||
'profile_photo_url': instance.photo,
|
||||
'badges': instance.badges,
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user