toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'name': name,
      'amount': (amount * 100).toStringAsFixed(0),
      'quantity': quantity,
      if (imageUrl != null) 'image': imageUrl,
    };