toMap method

Map<String, dynamic> toMap()

Creates a Map<String, dynamic> map representation of this instance.

This can be useful for saving the instance in a database.

Implementation

Map<String, dynamic> toMap() => <String, dynamic>{
      _brandKey: brand,
      _categoryKey: category,
      _costKey: '$cost',
      _descriptionKey: description,
      _idKey: id,
      _nameKey: name,
      _originKey: origin?.string(),
      _priceKey: '$price',
    };