refactor: Refactors StockPicking models; adds scanner navigation

Moves `StockPickingCompanyModel`, `StockPickingPartnerModel`,
`StockPickingLocationModel`, and `StockPickingTypeModel` to
`stock_picking_record_model.dart`. This consolidates related schema
definitions for improved organization and clarity.

Enables the floating action button on the reception details page
to navigate to the scanner route, streamlining the workflow.
This commit is contained in:
mandreshope 2025-07-30 14:22:03 +03:00
parent 6e49971883
commit 3f9f840a1c
8 changed files with 631 additions and 630 deletions

View File

@ -0,0 +1 @@
import 'package:objectbox/objectbox.dart';

View File

@ -26,46 +26,3 @@ abstract class StockPickingResultModel with _$StockPickingResultModel {
factory StockPickingResultModel.fromJson(Map<String, dynamic> json) => factory StockPickingResultModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingResultModelFromJson(json); _$StockPickingResultModelFromJson(json);
} }
@freezed
abstract class StockPickingCompanyModel with _$StockPickingCompanyModel {
const factory StockPickingCompanyModel({@JsonKey(name: 'id') int? id}) =
_StockPickingCompanyModel;
factory StockPickingCompanyModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingCompanyModelFromJson(json);
}
@freezed
abstract class StockPickingPartnerModel with _$StockPickingPartnerModel {
const factory StockPickingPartnerModel({
int? id,
@JsonKey(name: 'display_name') String? displayName,
}) = _StockPickingPartnerModel;
factory StockPickingPartnerModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingPartnerModelFromJson(json);
}
@freezed
abstract class StockPickingLocationModel with _$StockPickingLocationModel {
const factory StockPickingLocationModel({
int? id,
@JsonKey(name: 'complete_name') String? completeName,
}) = _StockPickingLocationModel;
factory StockPickingLocationModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingLocationModelFromJson(json);
}
@freezed
abstract class StockPickingTypeModel with _$StockPickingTypeModel {
const factory StockPickingTypeModel({
int? id,
@JsonKey(name: 'display_name') String? displayName,
}) = _StockPickingTypeModel;
factory StockPickingTypeModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingTypeModelFromJson(json);
}

View File

@ -317,547 +317,6 @@ as List<StockPickingRecordModel>?,
} }
}
/// @nodoc
mixin _$StockPickingCompanyModel {
@JsonKey(name: 'id') int? get id;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<StockPickingCompanyModel> get copyWith => _$StockPickingCompanyModelCopyWithImpl<StockPickingCompanyModel>(this as StockPickingCompanyModel, _$identity);
/// Serializes this StockPickingCompanyModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingCompanyModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'StockPickingCompanyModel(id: $id)';
}
}
/// @nodoc
abstract mixin class $StockPickingCompanyModelCopyWith<$Res> {
factory $StockPickingCompanyModelCopyWith(StockPickingCompanyModel value, $Res Function(StockPickingCompanyModel) _then) = _$StockPickingCompanyModelCopyWithImpl;
@useResult
$Res call({
@JsonKey(name: 'id') int? id
});
}
/// @nodoc
class _$StockPickingCompanyModelCopyWithImpl<$Res>
implements $StockPickingCompanyModelCopyWith<$Res> {
_$StockPickingCompanyModelCopyWithImpl(this._self, this._then);
final StockPickingCompanyModel _self;
final $Res Function(StockPickingCompanyModel) _then;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingCompanyModel implements StockPickingCompanyModel {
const _StockPickingCompanyModel({@JsonKey(name: 'id') this.id});
factory _StockPickingCompanyModel.fromJson(Map<String, dynamic> json) => _$StockPickingCompanyModelFromJson(json);
@override@JsonKey(name: 'id') final int? id;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingCompanyModelCopyWith<_StockPickingCompanyModel> get copyWith => __$StockPickingCompanyModelCopyWithImpl<_StockPickingCompanyModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingCompanyModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingCompanyModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'StockPickingCompanyModel(id: $id)';
}
}
/// @nodoc
abstract mixin class _$StockPickingCompanyModelCopyWith<$Res> implements $StockPickingCompanyModelCopyWith<$Res> {
factory _$StockPickingCompanyModelCopyWith(_StockPickingCompanyModel value, $Res Function(_StockPickingCompanyModel) _then) = __$StockPickingCompanyModelCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(name: 'id') int? id
});
}
/// @nodoc
class __$StockPickingCompanyModelCopyWithImpl<$Res>
implements _$StockPickingCompanyModelCopyWith<$Res> {
__$StockPickingCompanyModelCopyWithImpl(this._self, this._then);
final _StockPickingCompanyModel _self;
final $Res Function(_StockPickingCompanyModel) _then;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,}) {
return _then(_StockPickingCompanyModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
mixin _$StockPickingPartnerModel {
int? get id;@JsonKey(name: 'display_name') String? get displayName;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<StockPickingPartnerModel> get copyWith => _$StockPickingPartnerModelCopyWithImpl<StockPickingPartnerModel>(this as StockPickingPartnerModel, _$identity);
/// Serializes this StockPickingPartnerModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingPartnerModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class $StockPickingPartnerModelCopyWith<$Res> {
factory $StockPickingPartnerModelCopyWith(StockPickingPartnerModel value, $Res Function(StockPickingPartnerModel) _then) = _$StockPickingPartnerModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class _$StockPickingPartnerModelCopyWithImpl<$Res>
implements $StockPickingPartnerModelCopyWith<$Res> {
_$StockPickingPartnerModelCopyWithImpl(this._self, this._then);
final StockPickingPartnerModel _self;
final $Res Function(StockPickingPartnerModel) _then;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingPartnerModel implements StockPickingPartnerModel {
const _StockPickingPartnerModel({this.id, @JsonKey(name: 'display_name') this.displayName});
factory _StockPickingPartnerModel.fromJson(Map<String, dynamic> json) => _$StockPickingPartnerModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'display_name') final String? displayName;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingPartnerModelCopyWith<_StockPickingPartnerModel> get copyWith => __$StockPickingPartnerModelCopyWithImpl<_StockPickingPartnerModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingPartnerModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingPartnerModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingPartnerModelCopyWith<$Res> implements $StockPickingPartnerModelCopyWith<$Res> {
factory _$StockPickingPartnerModelCopyWith(_StockPickingPartnerModel value, $Res Function(_StockPickingPartnerModel) _then) = __$StockPickingPartnerModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class __$StockPickingPartnerModelCopyWithImpl<$Res>
implements _$StockPickingPartnerModelCopyWith<$Res> {
__$StockPickingPartnerModelCopyWithImpl(this._self, this._then);
final _StockPickingPartnerModel _self;
final $Res Function(_StockPickingPartnerModel) _then;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_StockPickingPartnerModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$StockPickingLocationModel {
int? get id;@JsonKey(name: 'complete_name') String? get completeName;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<StockPickingLocationModel> get copyWith => _$StockPickingLocationModelCopyWithImpl<StockPickingLocationModel>(this as StockPickingLocationModel, _$identity);
/// Serializes this StockPickingLocationModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,completeName);
@override
String toString() {
return 'StockPickingLocationModel(id: $id, completeName: $completeName)';
}
}
/// @nodoc
abstract mixin class $StockPickingLocationModelCopyWith<$Res> {
factory $StockPickingLocationModelCopyWith(StockPickingLocationModel value, $Res Function(StockPickingLocationModel) _then) = _$StockPickingLocationModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'complete_name') String? completeName
});
}
/// @nodoc
class _$StockPickingLocationModelCopyWithImpl<$Res>
implements $StockPickingLocationModelCopyWith<$Res> {
_$StockPickingLocationModelCopyWithImpl(this._self, this._then);
final StockPickingLocationModel _self;
final $Res Function(StockPickingLocationModel) _then;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? completeName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingLocationModel implements StockPickingLocationModel {
const _StockPickingLocationModel({this.id, @JsonKey(name: 'complete_name') this.completeName});
factory _StockPickingLocationModel.fromJson(Map<String, dynamic> json) => _$StockPickingLocationModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'complete_name') final String? completeName;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingLocationModelCopyWith<_StockPickingLocationModel> get copyWith => __$StockPickingLocationModelCopyWithImpl<_StockPickingLocationModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingLocationModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,completeName);
@override
String toString() {
return 'StockPickingLocationModel(id: $id, completeName: $completeName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingLocationModelCopyWith<$Res> implements $StockPickingLocationModelCopyWith<$Res> {
factory _$StockPickingLocationModelCopyWith(_StockPickingLocationModel value, $Res Function(_StockPickingLocationModel) _then) = __$StockPickingLocationModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'complete_name') String? completeName
});
}
/// @nodoc
class __$StockPickingLocationModelCopyWithImpl<$Res>
implements _$StockPickingLocationModelCopyWith<$Res> {
__$StockPickingLocationModelCopyWithImpl(this._self, this._then);
final _StockPickingLocationModel _self;
final $Res Function(_StockPickingLocationModel) _then;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? completeName = freezed,}) {
return _then(_StockPickingLocationModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$StockPickingTypeModel {
int? get id;@JsonKey(name: 'display_name') String? get displayName;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<StockPickingTypeModel> get copyWith => _$StockPickingTypeModelCopyWithImpl<StockPickingTypeModel>(this as StockPickingTypeModel, _$identity);
/// Serializes this StockPickingTypeModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingTypeModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class $StockPickingTypeModelCopyWith<$Res> {
factory $StockPickingTypeModelCopyWith(StockPickingTypeModel value, $Res Function(StockPickingTypeModel) _then) = _$StockPickingTypeModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class _$StockPickingTypeModelCopyWithImpl<$Res>
implements $StockPickingTypeModelCopyWith<$Res> {
_$StockPickingTypeModelCopyWithImpl(this._self, this._then);
final StockPickingTypeModel _self;
final $Res Function(StockPickingTypeModel) _then;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingTypeModel implements StockPickingTypeModel {
const _StockPickingTypeModel({this.id, @JsonKey(name: 'display_name') this.displayName});
factory _StockPickingTypeModel.fromJson(Map<String, dynamic> json) => _$StockPickingTypeModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'display_name') final String? displayName;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingTypeModelCopyWith<_StockPickingTypeModel> get copyWith => __$StockPickingTypeModelCopyWithImpl<_StockPickingTypeModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingTypeModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingTypeModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingTypeModelCopyWith<$Res> implements $StockPickingTypeModelCopyWith<$Res> {
factory _$StockPickingTypeModelCopyWith(_StockPickingTypeModel value, $Res Function(_StockPickingTypeModel) _then) = __$StockPickingTypeModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class __$StockPickingTypeModelCopyWithImpl<$Res>
implements _$StockPickingTypeModelCopyWith<$Res> {
__$StockPickingTypeModelCopyWithImpl(this._self, this._then);
final _StockPickingTypeModel _self;
final $Res Function(_StockPickingTypeModel) _then;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_StockPickingTypeModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
} }
// dart format on // dart format on

View File

@ -38,47 +38,3 @@ _StockPickingResultModel _$StockPickingResultModelFromJson(
Map<String, dynamic> _$StockPickingResultModelToJson( Map<String, dynamic> _$StockPickingResultModelToJson(
_StockPickingResultModel instance, _StockPickingResultModel instance,
) => <String, dynamic>{'length': instance.length, 'records': instance.records}; ) => <String, dynamic>{'length': instance.length, 'records': instance.records};
_StockPickingCompanyModel _$StockPickingCompanyModelFromJson(
Map<String, dynamic> json,
) => _StockPickingCompanyModel(id: (json['id'] as num?)?.toInt());
Map<String, dynamic> _$StockPickingCompanyModelToJson(
_StockPickingCompanyModel instance,
) => <String, dynamic>{'id': instance.id};
_StockPickingPartnerModel _$StockPickingPartnerModelFromJson(
Map<String, dynamic> json,
) => _StockPickingPartnerModel(
id: (json['id'] as num?)?.toInt(),
displayName: json['display_name'] as String?,
);
Map<String, dynamic> _$StockPickingPartnerModelToJson(
_StockPickingPartnerModel instance,
) => <String, dynamic>{'id': instance.id, 'display_name': instance.displayName};
_StockPickingLocationModel _$StockPickingLocationModelFromJson(
Map<String, dynamic> json,
) => _StockPickingLocationModel(
id: (json['id'] as num?)?.toInt(),
completeName: json['complete_name'] as String?,
);
Map<String, dynamic> _$StockPickingLocationModelToJson(
_StockPickingLocationModel instance,
) => <String, dynamic>{
'id': instance.id,
'complete_name': instance.completeName,
};
_StockPickingTypeModel _$StockPickingTypeModelFromJson(
Map<String, dynamic> json,
) => _StockPickingTypeModel(
id: (json['id'] as num?)?.toInt(),
displayName: json['display_name'] as String?,
);
Map<String, dynamic> _$StockPickingTypeModelToJson(
_StockPickingTypeModel instance,
) => <String, dynamic>{'id': instance.id, 'display_name': instance.displayName};

View File

@ -1,5 +1,4 @@
import 'package:e_scan/backend/schema/product/product_model.dart'; import 'package:e_scan/backend/schema/product/product_model.dart';
import 'package:e_scan/backend/schema/stock_picking/stock_picking_model.dart';
import 'package:e_scan/utils/utils.dart'; import 'package:e_scan/utils/utils.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
@ -68,6 +67,48 @@ List<MoveLineWithoutPackageModel>? _moveLineIdsWithoutPackageFromJson(
List<MoveWithoutPackageModel>? _moveIdsWithoutPackageFromJson(dynamic json) => List<MoveWithoutPackageModel>? _moveIdsWithoutPackageFromJson(dynamic json) =>
listFromJson(json, MoveWithoutPackageModel.fromJson); listFromJson(json, MoveWithoutPackageModel.fromJson);
@freezed
abstract class StockPickingCompanyModel with _$StockPickingCompanyModel {
const factory StockPickingCompanyModel({@JsonKey(name: 'id') int? id}) =
_StockPickingCompanyModel;
factory StockPickingCompanyModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingCompanyModelFromJson(json);
}
@freezed
abstract class StockPickingPartnerModel with _$StockPickingPartnerModel {
const factory StockPickingPartnerModel({
int? id,
@JsonKey(name: 'display_name') String? displayName,
}) = _StockPickingPartnerModel;
factory StockPickingPartnerModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingPartnerModelFromJson(json);
}
@freezed
abstract class StockPickingLocationModel with _$StockPickingLocationModel {
const factory StockPickingLocationModel({
int? id,
@JsonKey(name: 'complete_name') String? completeName,
}) = _StockPickingLocationModel;
factory StockPickingLocationModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingLocationModelFromJson(json);
}
@freezed
abstract class StockPickingTypeModel with _$StockPickingTypeModel {
const factory StockPickingTypeModel({
int? id,
@JsonKey(name: 'display_name') String? displayName,
}) = _StockPickingTypeModel;
factory StockPickingTypeModel.fromJson(Map<String, dynamic> json) =>
_$StockPickingTypeModelFromJson(json);
}
@freezed @freezed
abstract class MoveLineWithoutPackageModel with _$MoveLineWithoutPackageModel { abstract class MoveLineWithoutPackageModel with _$MoveLineWithoutPackageModel {
const factory MoveLineWithoutPackageModel({ const factory MoveLineWithoutPackageModel({

View File

@ -347,6 +347,547 @@ $StockPickingTypeModelCopyWith<$Res>? get pickingTypeId {
} }
/// @nodoc
mixin _$StockPickingCompanyModel {
@JsonKey(name: 'id') int? get id;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingCompanyModelCopyWith<StockPickingCompanyModel> get copyWith => _$StockPickingCompanyModelCopyWithImpl<StockPickingCompanyModel>(this as StockPickingCompanyModel, _$identity);
/// Serializes this StockPickingCompanyModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingCompanyModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'StockPickingCompanyModel(id: $id)';
}
}
/// @nodoc
abstract mixin class $StockPickingCompanyModelCopyWith<$Res> {
factory $StockPickingCompanyModelCopyWith(StockPickingCompanyModel value, $Res Function(StockPickingCompanyModel) _then) = _$StockPickingCompanyModelCopyWithImpl;
@useResult
$Res call({
@JsonKey(name: 'id') int? id
});
}
/// @nodoc
class _$StockPickingCompanyModelCopyWithImpl<$Res>
implements $StockPickingCompanyModelCopyWith<$Res> {
_$StockPickingCompanyModelCopyWithImpl(this._self, this._then);
final StockPickingCompanyModel _self;
final $Res Function(StockPickingCompanyModel) _then;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingCompanyModel implements StockPickingCompanyModel {
const _StockPickingCompanyModel({@JsonKey(name: 'id') this.id});
factory _StockPickingCompanyModel.fromJson(Map<String, dynamic> json) => _$StockPickingCompanyModelFromJson(json);
@override@JsonKey(name: 'id') final int? id;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingCompanyModelCopyWith<_StockPickingCompanyModel> get copyWith => __$StockPickingCompanyModelCopyWithImpl<_StockPickingCompanyModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingCompanyModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingCompanyModel&&(identical(other.id, id) || other.id == id));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id);
@override
String toString() {
return 'StockPickingCompanyModel(id: $id)';
}
}
/// @nodoc
abstract mixin class _$StockPickingCompanyModelCopyWith<$Res> implements $StockPickingCompanyModelCopyWith<$Res> {
factory _$StockPickingCompanyModelCopyWith(_StockPickingCompanyModel value, $Res Function(_StockPickingCompanyModel) _then) = __$StockPickingCompanyModelCopyWithImpl;
@override @useResult
$Res call({
@JsonKey(name: 'id') int? id
});
}
/// @nodoc
class __$StockPickingCompanyModelCopyWithImpl<$Res>
implements _$StockPickingCompanyModelCopyWith<$Res> {
__$StockPickingCompanyModelCopyWithImpl(this._self, this._then);
final _StockPickingCompanyModel _self;
final $Res Function(_StockPickingCompanyModel) _then;
/// Create a copy of StockPickingCompanyModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,}) {
return _then(_StockPickingCompanyModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
mixin _$StockPickingPartnerModel {
int? get id;@JsonKey(name: 'display_name') String? get displayName;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingPartnerModelCopyWith<StockPickingPartnerModel> get copyWith => _$StockPickingPartnerModelCopyWithImpl<StockPickingPartnerModel>(this as StockPickingPartnerModel, _$identity);
/// Serializes this StockPickingPartnerModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingPartnerModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class $StockPickingPartnerModelCopyWith<$Res> {
factory $StockPickingPartnerModelCopyWith(StockPickingPartnerModel value, $Res Function(StockPickingPartnerModel) _then) = _$StockPickingPartnerModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class _$StockPickingPartnerModelCopyWithImpl<$Res>
implements $StockPickingPartnerModelCopyWith<$Res> {
_$StockPickingPartnerModelCopyWithImpl(this._self, this._then);
final StockPickingPartnerModel _self;
final $Res Function(StockPickingPartnerModel) _then;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingPartnerModel implements StockPickingPartnerModel {
const _StockPickingPartnerModel({this.id, @JsonKey(name: 'display_name') this.displayName});
factory _StockPickingPartnerModel.fromJson(Map<String, dynamic> json) => _$StockPickingPartnerModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'display_name') final String? displayName;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingPartnerModelCopyWith<_StockPickingPartnerModel> get copyWith => __$StockPickingPartnerModelCopyWithImpl<_StockPickingPartnerModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingPartnerModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingPartnerModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingPartnerModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingPartnerModelCopyWith<$Res> implements $StockPickingPartnerModelCopyWith<$Res> {
factory _$StockPickingPartnerModelCopyWith(_StockPickingPartnerModel value, $Res Function(_StockPickingPartnerModel) _then) = __$StockPickingPartnerModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class __$StockPickingPartnerModelCopyWithImpl<$Res>
implements _$StockPickingPartnerModelCopyWith<$Res> {
__$StockPickingPartnerModelCopyWithImpl(this._self, this._then);
final _StockPickingPartnerModel _self;
final $Res Function(_StockPickingPartnerModel) _then;
/// Create a copy of StockPickingPartnerModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_StockPickingPartnerModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$StockPickingLocationModel {
int? get id;@JsonKey(name: 'complete_name') String? get completeName;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingLocationModelCopyWith<StockPickingLocationModel> get copyWith => _$StockPickingLocationModelCopyWithImpl<StockPickingLocationModel>(this as StockPickingLocationModel, _$identity);
/// Serializes this StockPickingLocationModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,completeName);
@override
String toString() {
return 'StockPickingLocationModel(id: $id, completeName: $completeName)';
}
}
/// @nodoc
abstract mixin class $StockPickingLocationModelCopyWith<$Res> {
factory $StockPickingLocationModelCopyWith(StockPickingLocationModel value, $Res Function(StockPickingLocationModel) _then) = _$StockPickingLocationModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'complete_name') String? completeName
});
}
/// @nodoc
class _$StockPickingLocationModelCopyWithImpl<$Res>
implements $StockPickingLocationModelCopyWith<$Res> {
_$StockPickingLocationModelCopyWithImpl(this._self, this._then);
final StockPickingLocationModel _self;
final $Res Function(StockPickingLocationModel) _then;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? completeName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingLocationModel implements StockPickingLocationModel {
const _StockPickingLocationModel({this.id, @JsonKey(name: 'complete_name') this.completeName});
factory _StockPickingLocationModel.fromJson(Map<String, dynamic> json) => _$StockPickingLocationModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'complete_name') final String? completeName;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingLocationModelCopyWith<_StockPickingLocationModel> get copyWith => __$StockPickingLocationModelCopyWithImpl<_StockPickingLocationModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingLocationModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.completeName, completeName) || other.completeName == completeName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,completeName);
@override
String toString() {
return 'StockPickingLocationModel(id: $id, completeName: $completeName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingLocationModelCopyWith<$Res> implements $StockPickingLocationModelCopyWith<$Res> {
factory _$StockPickingLocationModelCopyWith(_StockPickingLocationModel value, $Res Function(_StockPickingLocationModel) _then) = __$StockPickingLocationModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'complete_name') String? completeName
});
}
/// @nodoc
class __$StockPickingLocationModelCopyWithImpl<$Res>
implements _$StockPickingLocationModelCopyWith<$Res> {
__$StockPickingLocationModelCopyWithImpl(this._self, this._then);
final _StockPickingLocationModel _self;
final $Res Function(_StockPickingLocationModel) _then;
/// Create a copy of StockPickingLocationModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? completeName = freezed,}) {
return _then(_StockPickingLocationModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,completeName: freezed == completeName ? _self.completeName : completeName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$StockPickingTypeModel {
int? get id;@JsonKey(name: 'display_name') String? get displayName;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$StockPickingTypeModelCopyWith<StockPickingTypeModel> get copyWith => _$StockPickingTypeModelCopyWithImpl<StockPickingTypeModel>(this as StockPickingTypeModel, _$identity);
/// Serializes this StockPickingTypeModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingTypeModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class $StockPickingTypeModelCopyWith<$Res> {
factory $StockPickingTypeModelCopyWith(StockPickingTypeModel value, $Res Function(StockPickingTypeModel) _then) = _$StockPickingTypeModelCopyWithImpl;
@useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class _$StockPickingTypeModelCopyWithImpl<$Res>
implements $StockPickingTypeModelCopyWith<$Res> {
_$StockPickingTypeModelCopyWithImpl(this._self, this._then);
final StockPickingTypeModel _self;
final $Res Function(StockPickingTypeModel) _then;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _StockPickingTypeModel implements StockPickingTypeModel {
const _StockPickingTypeModel({this.id, @JsonKey(name: 'display_name') this.displayName});
factory _StockPickingTypeModel.fromJson(Map<String, dynamic> json) => _$StockPickingTypeModelFromJson(json);
@override final int? id;
@override@JsonKey(name: 'display_name') final String? displayName;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$StockPickingTypeModelCopyWith<_StockPickingTypeModel> get copyWith => __$StockPickingTypeModelCopyWithImpl<_StockPickingTypeModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$StockPickingTypeModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StockPickingTypeModel&&(identical(other.id, id) || other.id == id)&&(identical(other.displayName, displayName) || other.displayName == displayName));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,displayName);
@override
String toString() {
return 'StockPickingTypeModel(id: $id, displayName: $displayName)';
}
}
/// @nodoc
abstract mixin class _$StockPickingTypeModelCopyWith<$Res> implements $StockPickingTypeModelCopyWith<$Res> {
factory _$StockPickingTypeModelCopyWith(_StockPickingTypeModel value, $Res Function(_StockPickingTypeModel) _then) = __$StockPickingTypeModelCopyWithImpl;
@override @useResult
$Res call({
int? id,@JsonKey(name: 'display_name') String? displayName
});
}
/// @nodoc
class __$StockPickingTypeModelCopyWithImpl<$Res>
implements _$StockPickingTypeModelCopyWith<$Res> {
__$StockPickingTypeModelCopyWithImpl(this._self, this._then);
final _StockPickingTypeModel _self;
final $Res Function(_StockPickingTypeModel) _then;
/// Create a copy of StockPickingTypeModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? displayName = freezed,}) {
return _then(_StockPickingTypeModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc /// @nodoc
mixin _$MoveLineWithoutPackageModel { mixin _$MoveLineWithoutPackageModel {

View File

@ -72,6 +72,50 @@ Map<String, dynamic> _$StockPickingRecordModelToJson(
'move_ids_without_package': instance.moveIdsWithoutPackage, 'move_ids_without_package': instance.moveIdsWithoutPackage,
}; };
_StockPickingCompanyModel _$StockPickingCompanyModelFromJson(
Map<String, dynamic> json,
) => _StockPickingCompanyModel(id: (json['id'] as num?)?.toInt());
Map<String, dynamic> _$StockPickingCompanyModelToJson(
_StockPickingCompanyModel instance,
) => <String, dynamic>{'id': instance.id};
_StockPickingPartnerModel _$StockPickingPartnerModelFromJson(
Map<String, dynamic> json,
) => _StockPickingPartnerModel(
id: (json['id'] as num?)?.toInt(),
displayName: json['display_name'] as String?,
);
Map<String, dynamic> _$StockPickingPartnerModelToJson(
_StockPickingPartnerModel instance,
) => <String, dynamic>{'id': instance.id, 'display_name': instance.displayName};
_StockPickingLocationModel _$StockPickingLocationModelFromJson(
Map<String, dynamic> json,
) => _StockPickingLocationModel(
id: (json['id'] as num?)?.toInt(),
completeName: json['complete_name'] as String?,
);
Map<String, dynamic> _$StockPickingLocationModelToJson(
_StockPickingLocationModel instance,
) => <String, dynamic>{
'id': instance.id,
'complete_name': instance.completeName,
};
_StockPickingTypeModel _$StockPickingTypeModelFromJson(
Map<String, dynamic> json,
) => _StockPickingTypeModel(
id: (json['id'] as num?)?.toInt(),
displayName: json['display_name'] as String?,
);
Map<String, dynamic> _$StockPickingTypeModelToJson(
_StockPickingTypeModel instance,
) => <String, dynamic>{'id': instance.id, 'display_name': instance.displayName};
_MoveLineWithoutPackageModel _$MoveLineWithoutPackageModelFromJson( _MoveLineWithoutPackageModel _$MoveLineWithoutPackageModelFromJson(
Map<String, dynamic> json, Map<String, dynamic> json,
) => _MoveLineWithoutPackageModel( ) => _MoveLineWithoutPackageModel(

View File

@ -137,7 +137,9 @@ class _ReceptionDetailsPageState extends ConsumerState<ReceptionDetailsPage> {
floatingActionButton: reception?.isDone == false floatingActionButton: reception?.isDone == false
? FloatingActionButton( ? FloatingActionButton(
backgroundColor: AppTheme.of(context).primary, backgroundColor: AppTheme.of(context).primary,
onPressed: () {}, onPressed: () {
ScannerRoute().push(context);
},
child: Icon(Icons.qr_code, color: AppTheme.of(context).white), child: Icon(Icons.qr_code, color: AppTheme.of(context).white),
) )
: null, : null,