getProductChange method

  1. @override
Product getProductChange()
override

Returns a product with "unselected" image.

The problem is that null may mean both

  • "I don't change this value"
  • "I change the value to null" Here we put an empty string instead, to be understood as "force to null!".

Implementation

@override
Product getProductChange() {
  final Product result = Product(barcode: barcode);
  ImageField.fromOffTag(imageField)!.setUrl(result, '');
  return result;
}