
Refactors the product data model to primarily store `id`, `barcode`, and `displayName`. This simplifies the product structure, focusing on essential attributes for inventory and scanning operations. Optimizes API calls for stock picking to fetch more relevant product details. Unnecessary fields are removed, and specific product attributes like `barcode` and `quantity` are now explicitly requested for stock moves. Moves `StockPickingRecordModel` to its own dedicated file for improved code organization and maintainability. Updates all affected UI components and scanner logic to align with the revised product model.
155 lines
5.2 KiB
Dart
155 lines
5.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 'product_model.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$ProductModel {
|
|
|
|
int? get id; String? get barcode; String? get displayName;
|
|
/// Create a copy of ProductModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$ProductModelCopyWith<ProductModel> get copyWith => _$ProductModelCopyWithImpl<ProductModel>(this as ProductModel, _$identity);
|
|
|
|
/// Serializes this ProductModel to a JSON map.
|
|
Map<String, dynamic> toJson();
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.barcode, barcode) || other.barcode == barcode)&&(identical(other.displayName, displayName) || other.displayName == displayName));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,barcode,displayName);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ProductModel(id: $id, barcode: $barcode, displayName: $displayName)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $ProductModelCopyWith<$Res> {
|
|
factory $ProductModelCopyWith(ProductModel value, $Res Function(ProductModel) _then) = _$ProductModelCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
int? id, String? barcode, String? displayName
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class _$ProductModelCopyWithImpl<$Res>
|
|
implements $ProductModelCopyWith<$Res> {
|
|
_$ProductModelCopyWithImpl(this._self, this._then);
|
|
|
|
final ProductModel _self;
|
|
final $Res Function(ProductModel) _then;
|
|
|
|
/// Create a copy of ProductModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? barcode = freezed,Object? displayName = freezed,}) {
|
|
return _then(_self.copyWith(
|
|
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as int?,barcode: freezed == barcode ? _self.barcode : barcode // ignore: cast_nullable_to_non_nullable
|
|
as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
|
|
class _ProductModel implements ProductModel {
|
|
_ProductModel({this.id, this.barcode, this.displayName});
|
|
factory _ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
|
|
|
|
@override final int? id;
|
|
@override final String? barcode;
|
|
@override final String? displayName;
|
|
|
|
/// Create a copy of ProductModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$ProductModelCopyWith<_ProductModel> get copyWith => __$ProductModelCopyWithImpl<_ProductModel>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$ProductModelToJson(this, );
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProductModel&&(identical(other.id, id) || other.id == id)&&(identical(other.barcode, barcode) || other.barcode == barcode)&&(identical(other.displayName, displayName) || other.displayName == displayName));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType,id,barcode,displayName);
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ProductModel(id: $id, barcode: $barcode, displayName: $displayName)';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$ProductModelCopyWith<$Res> implements $ProductModelCopyWith<$Res> {
|
|
factory _$ProductModelCopyWith(_ProductModel value, $Res Function(_ProductModel) _then) = __$ProductModelCopyWithImpl;
|
|
@override @useResult
|
|
$Res call({
|
|
int? id, String? barcode, String? displayName
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
/// @nodoc
|
|
class __$ProductModelCopyWithImpl<$Res>
|
|
implements _$ProductModelCopyWith<$Res> {
|
|
__$ProductModelCopyWithImpl(this._self, this._then);
|
|
|
|
final _ProductModel _self;
|
|
final $Res Function(_ProductModel) _then;
|
|
|
|
/// Create a copy of ProductModel
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? barcode = freezed,Object? displayName = freezed,}) {
|
|
return _then(_ProductModel(
|
|
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
|
as int?,barcode: freezed == barcode ? _self.barcode : barcode // ignore: cast_nullable_to_non_nullable
|
|
as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
));
|
|
}
|
|
|
|
|
|
}
|
|
|
|
// dart format on
|