barcode_scanner/lib/pages/operation/reception/reception_page_model.freezed.dart
mandreshope 61345869e1 feat: Implements stock picking data fetching WIP1
Adds a new API call (`getAllStockPiking`) to retrieve stock picking records from the backend.

Refactors stock picking data models:
- Renames models for better clarity (e.g., `StockPickingResponse` to `StockPickingResponseModel`).
- Makes all model fields nullable to handle varying API responses gracefully.
- Introduces specific nested models (`StockPickingCompanyModel`, `StockPickingPartnerModel`, `StockPickingLocationModel`, `StockPickingTypeModel`) for related entities, enhancing type safety and data structure.

Integrates the new API call into `ReceptionPageModel` and introduces distinct loading states (`loadingUser`, `loadingReceptions`) for improved UI feedback.
2025-07-29 11:47:06 +03:00

212 lines
8.7 KiB
Dart

// dart format width=80
// 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 'reception_page_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$ReceptionPageState implements DiagnosticableTreeMixin {
UserStruct? get user; StockPickingResponseModel? get receptions; bool get loadingReceptions; bool get loadingUser;
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ReceptionPageStateCopyWith<ReceptionPageState> get copyWith => _$ReceptionPageStateCopyWithImpl<ReceptionPageState>(this as ReceptionPageState, _$identity);
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'ReceptionPageState'))
..add(DiagnosticsProperty('user', user))..add(DiagnosticsProperty('receptions', receptions))..add(DiagnosticsProperty('loadingReceptions', loadingReceptions))..add(DiagnosticsProperty('loadingUser', loadingUser));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ReceptionPageState&&(identical(other.user, user) || other.user == user)&&(identical(other.receptions, receptions) || other.receptions == receptions)&&(identical(other.loadingReceptions, loadingReceptions) || other.loadingReceptions == loadingReceptions)&&(identical(other.loadingUser, loadingUser) || other.loadingUser == loadingUser));
}
@override
int get hashCode => Object.hash(runtimeType,user,receptions,loadingReceptions,loadingUser);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'ReceptionPageState(user: $user, receptions: $receptions, loadingReceptions: $loadingReceptions, loadingUser: $loadingUser)';
}
}
/// @nodoc
abstract mixin class $ReceptionPageStateCopyWith<$Res> {
factory $ReceptionPageStateCopyWith(ReceptionPageState value, $Res Function(ReceptionPageState) _then) = _$ReceptionPageStateCopyWithImpl;
@useResult
$Res call({
UserStruct? user, StockPickingResponseModel? receptions, bool loadingReceptions, bool loadingUser
});
$UserStructCopyWith<$Res>? get user;$StockPickingResponseModelCopyWith<$Res>? get receptions;
}
/// @nodoc
class _$ReceptionPageStateCopyWithImpl<$Res>
implements $ReceptionPageStateCopyWith<$Res> {
_$ReceptionPageStateCopyWithImpl(this._self, this._then);
final ReceptionPageState _self;
final $Res Function(ReceptionPageState) _then;
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? user = freezed,Object? receptions = freezed,Object? loadingReceptions = null,Object? loadingUser = null,}) {
return _then(_self.copyWith(
user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as UserStruct?,receptions: freezed == receptions ? _self.receptions : receptions // ignore: cast_nullable_to_non_nullable
as StockPickingResponseModel?,loadingReceptions: null == loadingReceptions ? _self.loadingReceptions : loadingReceptions // ignore: cast_nullable_to_non_nullable
as bool,loadingUser: null == loadingUser ? _self.loadingUser : loadingUser // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserStructCopyWith<$Res>? get user {
if (_self.user == null) {
return null;
}
return $UserStructCopyWith<$Res>(_self.user!, (value) {
return _then(_self.copyWith(user: value));
});
}/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingResponseModelCopyWith<$Res>? get receptions {
if (_self.receptions == null) {
return null;
}
return $StockPickingResponseModelCopyWith<$Res>(_self.receptions!, (value) {
return _then(_self.copyWith(receptions: value));
});
}
}
/// @nodoc
class _ReceptionPageState with DiagnosticableTreeMixin implements ReceptionPageState {
const _ReceptionPageState({this.user, this.receptions, this.loadingReceptions = false, this.loadingUser = false});
@override final UserStruct? user;
@override final StockPickingResponseModel? receptions;
@override@JsonKey() final bool loadingReceptions;
@override@JsonKey() final bool loadingUser;
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ReceptionPageStateCopyWith<_ReceptionPageState> get copyWith => __$ReceptionPageStateCopyWithImpl<_ReceptionPageState>(this, _$identity);
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'ReceptionPageState'))
..add(DiagnosticsProperty('user', user))..add(DiagnosticsProperty('receptions', receptions))..add(DiagnosticsProperty('loadingReceptions', loadingReceptions))..add(DiagnosticsProperty('loadingUser', loadingUser));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ReceptionPageState&&(identical(other.user, user) || other.user == user)&&(identical(other.receptions, receptions) || other.receptions == receptions)&&(identical(other.loadingReceptions, loadingReceptions) || other.loadingReceptions == loadingReceptions)&&(identical(other.loadingUser, loadingUser) || other.loadingUser == loadingUser));
}
@override
int get hashCode => Object.hash(runtimeType,user,receptions,loadingReceptions,loadingUser);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'ReceptionPageState(user: $user, receptions: $receptions, loadingReceptions: $loadingReceptions, loadingUser: $loadingUser)';
}
}
/// @nodoc
abstract mixin class _$ReceptionPageStateCopyWith<$Res> implements $ReceptionPageStateCopyWith<$Res> {
factory _$ReceptionPageStateCopyWith(_ReceptionPageState value, $Res Function(_ReceptionPageState) _then) = __$ReceptionPageStateCopyWithImpl;
@override @useResult
$Res call({
UserStruct? user, StockPickingResponseModel? receptions, bool loadingReceptions, bool loadingUser
});
@override $UserStructCopyWith<$Res>? get user;@override $StockPickingResponseModelCopyWith<$Res>? get receptions;
}
/// @nodoc
class __$ReceptionPageStateCopyWithImpl<$Res>
implements _$ReceptionPageStateCopyWith<$Res> {
__$ReceptionPageStateCopyWithImpl(this._self, this._then);
final _ReceptionPageState _self;
final $Res Function(_ReceptionPageState) _then;
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? user = freezed,Object? receptions = freezed,Object? loadingReceptions = null,Object? loadingUser = null,}) {
return _then(_ReceptionPageState(
user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as UserStruct?,receptions: freezed == receptions ? _self.receptions : receptions // ignore: cast_nullable_to_non_nullable
as StockPickingResponseModel?,loadingReceptions: null == loadingReceptions ? _self.loadingReceptions : loadingReceptions // ignore: cast_nullable_to_non_nullable
as bool,loadingUser: null == loadingUser ? _self.loadingUser : loadingUser // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UserStructCopyWith<$Res>? get user {
if (_self.user == null) {
return null;
}
return $UserStructCopyWith<$Res>(_self.user!, (value) {
return _then(_self.copyWith(user: value));
});
}/// Create a copy of ReceptionPageState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StockPickingResponseModelCopyWith<$Res>? get receptions {
if (_self.receptions == null) {
return null;
}
return $StockPickingResponseModelCopyWith<$Res>(_self.receptions!, (value) {
return _then(_self.copyWith(receptions: value));
});
}
}
// dart format on