toPrice static method

AffiseProductPrice? toPrice(
  1. dynamic from
)

Implementation

static AffiseProductPrice? toPrice(dynamic from) {
  var json = tryCast<Map<Object?, Object?>>(from);
  if (json == null) return null;

  return AffiseProductPrice(
    value: (json[DataName.VALUE] as double?) ?? -1.1,
    currencyCode: (json[DataName.CURRENCY_CODE] as String?) ?? "",
    formattedPrice: (json[DataName.FORMATTED_PRICE] as String?) ?? "",
  );
}