toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (availability != null) {
    json['availability'] = availability;
  }
  json['brand'] = brand;
  json['created_at'] = createdAt.toIso8601String();
  if (defaultChoice != null) {
    json['default_choice'] = defaultChoice;
  }
  if (id != null) {
    json['id'] = id;
  }
  json['power'] = power;
  json['price'] = price;
  json['updated_at'] = updatedAt.toIso8601String();
  return json;
}