
Adds the ObjectBox database dependency for local data persistence. Updates the Product ID field type from nullable String to non-nullable int with a default value of 0 to align with ObjectBox's integer ID requirements. Includes necessary generated files for plugin registration and model serialization.
20 lines
482 B
Dart
20 lines
482 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,
|
|
}) = _ProductStruct;
|
|
|
|
factory ProductStruct.fromJson(Map<String, dynamic> json) =>
|
|
_$ProductStructFromJson(json);
|
|
}
|