barcode_scanner/lib/pages/operation/reception/reception_page_model.freezed.dart
mandreshope 1d15fd4d1c refactor: Streamlines stock picking data model
Refactors the `getAllStockPiking` API call to directly return a list of `StockPickingRecordModel`.

This change simplifies the data structure by removing the `StockPickingResponseModel` wrapper, making the `receptions` state in `ReceptionPageState` a direct, non-nullable list. It improves type safety and reduces verbose property access in the UI.
2025-07-30 14:32:28 +03:00

194 lines
8.2 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; List<StockPickingRecordModel> 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)&&const DeepCollectionEquality().equals(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,const DeepCollectionEquality().hash(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, List<StockPickingRecordModel> receptions, bool loadingReceptions, bool loadingUser
});
$UserStructCopyWith<$Res>? get user;
}
/// @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 = null,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: null == receptions ? _self.receptions : receptions // ignore: cast_nullable_to_non_nullable
as List<StockPickingRecordModel>,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));
});
}
}
/// @nodoc
class _ReceptionPageState with DiagnosticableTreeMixin implements ReceptionPageState {
const _ReceptionPageState({this.user, final List<StockPickingRecordModel> receptions = const <StockPickingRecordModel>[], this.loadingReceptions = false, this.loadingUser = false}): _receptions = receptions;
@override final UserStruct? user;
final List<StockPickingRecordModel> _receptions;
@override@JsonKey() List<StockPickingRecordModel> get receptions {
if (_receptions is EqualUnmodifiableListView) return _receptions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_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)&&const DeepCollectionEquality().equals(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,const DeepCollectionEquality().hash(_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, List<StockPickingRecordModel> receptions, bool loadingReceptions, bool loadingUser
});
@override $UserStructCopyWith<$Res>? get user;
}
/// @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 = null,Object? loadingReceptions = null,Object? loadingUser = null,}) {
return _then(_ReceptionPageState(
user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as UserStruct?,receptions: null == receptions ? _self._receptions : receptions // ignore: cast_nullable_to_non_nullable
as List<StockPickingRecordModel>,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));
});
}
}
// dart format on