bharat_erp/lib/shared/models/api_response.freezed.dart
SurendarSuri30 8f852ac4f6 Initial commit: Bharat ERP Flutter application.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 15:04:06 +05:30

757 lines
22 KiB
Dart

// 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 'api_response.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',
);
ApiResponse<T> _$ApiResponseFromJson<T>(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) {
return _ApiResponse<T>.fromJson(json, fromJsonT);
}
/// @nodoc
mixin _$ApiResponse<T> {
bool get success => throw _privateConstructorUsedError;
String get message => throw _privateConstructorUsedError;
T? get data => throw _privateConstructorUsedError;
Map<String, dynamic>? get meta => throw _privateConstructorUsedError;
/// Serializes this ApiResponse to a JSON map.
Map<String, dynamic> toJson(Object? Function(T) toJsonT) =>
throw _privateConstructorUsedError;
/// Create a copy of ApiResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ApiResponseCopyWith<T, ApiResponse<T>> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ApiResponseCopyWith<T, $Res> {
factory $ApiResponseCopyWith(
ApiResponse<T> value,
$Res Function(ApiResponse<T>) then,
) = _$ApiResponseCopyWithImpl<T, $Res, ApiResponse<T>>;
@useResult
$Res call({
bool success,
String message,
T? data,
Map<String, dynamic>? meta,
});
}
/// @nodoc
class _$ApiResponseCopyWithImpl<T, $Res, $Val extends ApiResponse<T>>
implements $ApiResponseCopyWith<T, $Res> {
_$ApiResponseCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ApiResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? success = null,
Object? message = null,
Object? data = freezed,
Object? meta = freezed,
}) {
return _then(
_value.copyWith(
success: null == success
? _value.success
: success // ignore: cast_nullable_to_non_nullable
as bool,
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as T?,
meta: freezed == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$ApiResponseImplCopyWith<T, $Res>
implements $ApiResponseCopyWith<T, $Res> {
factory _$$ApiResponseImplCopyWith(
_$ApiResponseImpl<T> value,
$Res Function(_$ApiResponseImpl<T>) then,
) = __$$ApiResponseImplCopyWithImpl<T, $Res>;
@override
@useResult
$Res call({
bool success,
String message,
T? data,
Map<String, dynamic>? meta,
});
}
/// @nodoc
class __$$ApiResponseImplCopyWithImpl<T, $Res>
extends _$ApiResponseCopyWithImpl<T, $Res, _$ApiResponseImpl<T>>
implements _$$ApiResponseImplCopyWith<T, $Res> {
__$$ApiResponseImplCopyWithImpl(
_$ApiResponseImpl<T> _value,
$Res Function(_$ApiResponseImpl<T>) _then,
) : super(_value, _then);
/// Create a copy of ApiResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? success = null,
Object? message = null,
Object? data = freezed,
Object? meta = freezed,
}) {
return _then(
_$ApiResponseImpl<T>(
success: null == success
? _value.success
: success // ignore: cast_nullable_to_non_nullable
as bool,
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as T?,
meta: freezed == meta
? _value._meta
: meta // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
),
);
}
}
/// @nodoc
@JsonSerializable(genericArgumentFactories: true)
class _$ApiResponseImpl<T> implements _ApiResponse<T> {
const _$ApiResponseImpl({
required this.success,
required this.message,
this.data,
final Map<String, dynamic>? meta,
}) : _meta = meta;
factory _$ApiResponseImpl.fromJson(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) => _$$ApiResponseImplFromJson(json, fromJsonT);
@override
final bool success;
@override
final String message;
@override
final T? data;
final Map<String, dynamic>? _meta;
@override
Map<String, dynamic>? get meta {
final value = _meta;
if (value == null) return null;
if (_meta is EqualUnmodifiableMapView) return _meta;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}
@override
String toString() {
return 'ApiResponse<$T>(success: $success, message: $message, data: $data, meta: $meta)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ApiResponseImpl<T> &&
(identical(other.success, success) || other.success == success) &&
(identical(other.message, message) || other.message == message) &&
const DeepCollectionEquality().equals(other.data, data) &&
const DeepCollectionEquality().equals(other._meta, _meta));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
success,
message,
const DeepCollectionEquality().hash(data),
const DeepCollectionEquality().hash(_meta),
);
/// Create a copy of ApiResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ApiResponseImplCopyWith<T, _$ApiResponseImpl<T>> get copyWith =>
__$$ApiResponseImplCopyWithImpl<T, _$ApiResponseImpl<T>>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson(Object? Function(T) toJsonT) {
return _$$ApiResponseImplToJson<T>(this, toJsonT);
}
}
abstract class _ApiResponse<T> implements ApiResponse<T> {
const factory _ApiResponse({
required final bool success,
required final String message,
final T? data,
final Map<String, dynamic>? meta,
}) = _$ApiResponseImpl<T>;
factory _ApiResponse.fromJson(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) = _$ApiResponseImpl<T>.fromJson;
@override
bool get success;
@override
String get message;
@override
T? get data;
@override
Map<String, dynamic>? get meta;
/// Create a copy of ApiResponse
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ApiResponseImplCopyWith<T, _$ApiResponseImpl<T>> get copyWith =>
throw _privateConstructorUsedError;
}
PaginatedResponse<T> _$PaginatedResponseFromJson<T>(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) {
return _PaginatedResponse<T>.fromJson(json, fromJsonT);
}
/// @nodoc
mixin _$PaginatedResponse<T> {
List<T> get items => throw _privateConstructorUsedError;
int get page => throw _privateConstructorUsedError;
int get limit => throw _privateConstructorUsedError;
int get total => throw _privateConstructorUsedError;
int get totalPages => throw _privateConstructorUsedError;
/// Serializes this PaginatedResponse to a JSON map.
Map<String, dynamic> toJson(Object? Function(T) toJsonT) =>
throw _privateConstructorUsedError;
/// Create a copy of PaginatedResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PaginatedResponseCopyWith<T, PaginatedResponse<T>> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PaginatedResponseCopyWith<T, $Res> {
factory $PaginatedResponseCopyWith(
PaginatedResponse<T> value,
$Res Function(PaginatedResponse<T>) then,
) = _$PaginatedResponseCopyWithImpl<T, $Res, PaginatedResponse<T>>;
@useResult
$Res call({List<T> items, int page, int limit, int total, int totalPages});
}
/// @nodoc
class _$PaginatedResponseCopyWithImpl<
T,
$Res,
$Val extends PaginatedResponse<T>
>
implements $PaginatedResponseCopyWith<T, $Res> {
_$PaginatedResponseCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PaginatedResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? items = null,
Object? page = null,
Object? limit = null,
Object? total = null,
Object? totalPages = null,
}) {
return _then(
_value.copyWith(
items: null == items
? _value.items
: items // ignore: cast_nullable_to_non_nullable
as List<T>,
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalPages: null == totalPages
? _value.totalPages
: totalPages // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$PaginatedResponseImplCopyWith<T, $Res>
implements $PaginatedResponseCopyWith<T, $Res> {
factory _$$PaginatedResponseImplCopyWith(
_$PaginatedResponseImpl<T> value,
$Res Function(_$PaginatedResponseImpl<T>) then,
) = __$$PaginatedResponseImplCopyWithImpl<T, $Res>;
@override
@useResult
$Res call({List<T> items, int page, int limit, int total, int totalPages});
}
/// @nodoc
class __$$PaginatedResponseImplCopyWithImpl<T, $Res>
extends _$PaginatedResponseCopyWithImpl<T, $Res, _$PaginatedResponseImpl<T>>
implements _$$PaginatedResponseImplCopyWith<T, $Res> {
__$$PaginatedResponseImplCopyWithImpl(
_$PaginatedResponseImpl<T> _value,
$Res Function(_$PaginatedResponseImpl<T>) _then,
) : super(_value, _then);
/// Create a copy of PaginatedResponse
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? items = null,
Object? page = null,
Object? limit = null,
Object? total = null,
Object? totalPages = null,
}) {
return _then(
_$PaginatedResponseImpl<T>(
items: null == items
? _value._items
: items // ignore: cast_nullable_to_non_nullable
as List<T>,
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalPages: null == totalPages
? _value.totalPages
: totalPages // ignore: cast_nullable_to_non_nullable
as int,
),
);
}
}
/// @nodoc
@JsonSerializable(genericArgumentFactories: true)
class _$PaginatedResponseImpl<T> implements _PaginatedResponse<T> {
const _$PaginatedResponseImpl({
required final List<T> items,
required this.page,
required this.limit,
required this.total,
required this.totalPages,
}) : _items = items;
factory _$PaginatedResponseImpl.fromJson(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) => _$$PaginatedResponseImplFromJson(json, fromJsonT);
final List<T> _items;
@override
List<T> get items {
if (_items is EqualUnmodifiableListView) return _items;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_items);
}
@override
final int page;
@override
final int limit;
@override
final int total;
@override
final int totalPages;
@override
String toString() {
return 'PaginatedResponse<$T>(items: $items, page: $page, limit: $limit, total: $total, totalPages: $totalPages)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaginatedResponseImpl<T> &&
const DeepCollectionEquality().equals(other._items, _items) &&
(identical(other.page, page) || other.page == page) &&
(identical(other.limit, limit) || other.limit == limit) &&
(identical(other.total, total) || other.total == total) &&
(identical(other.totalPages, totalPages) ||
other.totalPages == totalPages));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_items),
page,
limit,
total,
totalPages,
);
/// Create a copy of PaginatedResponse
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PaginatedResponseImplCopyWith<T, _$PaginatedResponseImpl<T>>
get copyWith =>
__$$PaginatedResponseImplCopyWithImpl<T, _$PaginatedResponseImpl<T>>(
this,
_$identity,
);
@override
Map<String, dynamic> toJson(Object? Function(T) toJsonT) {
return _$$PaginatedResponseImplToJson<T>(this, toJsonT);
}
}
abstract class _PaginatedResponse<T> implements PaginatedResponse<T> {
const factory _PaginatedResponse({
required final List<T> items,
required final int page,
required final int limit,
required final int total,
required final int totalPages,
}) = _$PaginatedResponseImpl<T>;
factory _PaginatedResponse.fromJson(
Map<String, dynamic> json,
T Function(Object?) fromJsonT,
) = _$PaginatedResponseImpl<T>.fromJson;
@override
List<T> get items;
@override
int get page;
@override
int get limit;
@override
int get total;
@override
int get totalPages;
/// Create a copy of PaginatedResponse
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PaginatedResponseImplCopyWith<T, _$PaginatedResponseImpl<T>>
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$PaginationParams {
int get page => throw _privateConstructorUsedError;
int get limit => throw _privateConstructorUsedError;
String? get search => throw _privateConstructorUsedError;
String? get sortBy => throw _privateConstructorUsedError;
String get sortOrder => throw _privateConstructorUsedError;
/// Create a copy of PaginationParams
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PaginationParamsCopyWith<PaginationParams> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PaginationParamsCopyWith<$Res> {
factory $PaginationParamsCopyWith(
PaginationParams value,
$Res Function(PaginationParams) then,
) = _$PaginationParamsCopyWithImpl<$Res, PaginationParams>;
@useResult
$Res call({
int page,
int limit,
String? search,
String? sortBy,
String sortOrder,
});
}
/// @nodoc
class _$PaginationParamsCopyWithImpl<$Res, $Val extends PaginationParams>
implements $PaginationParamsCopyWith<$Res> {
_$PaginationParamsCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PaginationParams
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? page = null,
Object? limit = null,
Object? search = freezed,
Object? sortBy = freezed,
Object? sortOrder = null,
}) {
return _then(
_value.copyWith(
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
search: freezed == search
? _value.search
: search // ignore: cast_nullable_to_non_nullable
as String?,
sortBy: freezed == sortBy
? _value.sortBy
: sortBy // ignore: cast_nullable_to_non_nullable
as String?,
sortOrder: null == sortOrder
? _value.sortOrder
: sortOrder // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
}
}
/// @nodoc
abstract class _$$PaginationParamsImplCopyWith<$Res>
implements $PaginationParamsCopyWith<$Res> {
factory _$$PaginationParamsImplCopyWith(
_$PaginationParamsImpl value,
$Res Function(_$PaginationParamsImpl) then,
) = __$$PaginationParamsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int page,
int limit,
String? search,
String? sortBy,
String sortOrder,
});
}
/// @nodoc
class __$$PaginationParamsImplCopyWithImpl<$Res>
extends _$PaginationParamsCopyWithImpl<$Res, _$PaginationParamsImpl>
implements _$$PaginationParamsImplCopyWith<$Res> {
__$$PaginationParamsImplCopyWithImpl(
_$PaginationParamsImpl _value,
$Res Function(_$PaginationParamsImpl) _then,
) : super(_value, _then);
/// Create a copy of PaginationParams
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? page = null,
Object? limit = null,
Object? search = freezed,
Object? sortBy = freezed,
Object? sortOrder = null,
}) {
return _then(
_$PaginationParamsImpl(
page: null == page
? _value.page
: page // ignore: cast_nullable_to_non_nullable
as int,
limit: null == limit
? _value.limit
: limit // ignore: cast_nullable_to_non_nullable
as int,
search: freezed == search
? _value.search
: search // ignore: cast_nullable_to_non_nullable
as String?,
sortBy: freezed == sortBy
? _value.sortBy
: sortBy // ignore: cast_nullable_to_non_nullable
as String?,
sortOrder: null == sortOrder
? _value.sortOrder
: sortOrder // ignore: cast_nullable_to_non_nullable
as String,
),
);
}
}
/// @nodoc
class _$PaginationParamsImpl implements _PaginationParams {
const _$PaginationParamsImpl({
this.page = 1,
this.limit = 20,
this.search,
this.sortBy,
this.sortOrder = 'asc',
});
@override
@JsonKey()
final int page;
@override
@JsonKey()
final int limit;
@override
final String? search;
@override
final String? sortBy;
@override
@JsonKey()
final String sortOrder;
@override
String toString() {
return 'PaginationParams(page: $page, limit: $limit, search: $search, sortBy: $sortBy, sortOrder: $sortOrder)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaginationParamsImpl &&
(identical(other.page, page) || other.page == page) &&
(identical(other.limit, limit) || other.limit == limit) &&
(identical(other.search, search) || other.search == search) &&
(identical(other.sortBy, sortBy) || other.sortBy == sortBy) &&
(identical(other.sortOrder, sortOrder) ||
other.sortOrder == sortOrder));
}
@override
int get hashCode =>
Object.hash(runtimeType, page, limit, search, sortBy, sortOrder);
/// Create a copy of PaginationParams
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PaginationParamsImplCopyWith<_$PaginationParamsImpl> get copyWith =>
__$$PaginationParamsImplCopyWithImpl<_$PaginationParamsImpl>(
this,
_$identity,
);
}
abstract class _PaginationParams implements PaginationParams {
const factory _PaginationParams({
final int page,
final int limit,
final String? search,
final String? sortBy,
final String sortOrder,
}) = _$PaginationParamsImpl;
@override
int get page;
@override
int get limit;
@override
String? get search;
@override
String? get sortBy;
@override
String get sortOrder;
/// Create a copy of PaginationParams
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PaginationParamsImplCopyWith<_$PaginationParamsImpl> get copyWith =>
throw _privateConstructorUsedError;
}