
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.
30 lines
978 B
Dart
30 lines
978 B
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'product_struct.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_ProductStruct _$ProductStructFromJson(Map<String, dynamic> json) =>
|
|
_ProductStruct(
|
|
id: (json['id'] as num?)?.toInt() ?? 0,
|
|
code: json['code'] as String?,
|
|
name: json['name'] as String?,
|
|
description: json['description'] as String?,
|
|
price: json['price'] as String?,
|
|
quantity: json['quantity'] as String?,
|
|
image: json['image'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ProductStructToJson(_ProductStruct instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'code': instance.code,
|
|
'name': instance.name,
|
|
'description': instance.description,
|
|
'price': instance.price,
|
|
'quantity': instance.quantity,
|
|
'image': instance.image,
|
|
};
|