barcode_scanner/lib/backend/schema/product/product_struct.dart
mandreshope 44289e29dc feat: Adds product image field to data models
Includes an `image` field in the `ProductStruct` and `ProductEntity` data models.

Updates the ObjectBox schema and regenerates the necessary code to persist the new field.

Refactors the `ProductScannedComponent` to accept a `ProductStruct` object, simplifying parameter passing.

Updates the `ScannerPage` to build and pass the `ProductStruct` to the component, enabling the display of the product image and using the structured data for other details like quantity. The 'Marque' display is replaced with 'Quantité' in the component.
2025-07-03 17:20:44 +03:00

21 lines
501 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'product_struct.freezed.dart';
part 'product_struct.g.dart';
@Freezed(toJson: true)
abstract class ProductStruct with _$ProductStruct {
factory ProductStruct({
@Default(0) int id,
String? code,
String? name,
String? description,
String? price,
String? quantity,
String? image,
}) = _ProductStruct;
factory ProductStruct.fromJson(Map<String, dynamic> json) =>
_$ProductStructFromJson(json);
}