fromMap static method

PaymentReceipt? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static PaymentReceipt? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var title = _map['title']! as String;
  var description = FormattedText.fromMap(_map['description'])!;
  var photo = Photo.fromMap(_map['photo']);
  var date = _map['date']! as int;
  var seller_bot_user_id = _map['seller_bot_user_id']! as int;
  var payment_provider_user_id = _map['payment_provider_user_id']! as int;
  var invoice = Invoice.fromMap(_map['invoice'])!;
  var order_info = OrderInfo.fromMap(_map['order_info']);
  var shipping_option = ShippingOption.fromMap(_map['shipping_option']);
  var credentials_title = _map['credentials_title']! as String;
  var tip_amount = _map['tip_amount']! as int;
  return PaymentReceipt(
    extra: extra,
    clientId: clientId,
    title: title,
    description: description,
    photo: photo,
    date: date,
    seller_bot_user_id: seller_bot_user_id,
    payment_provider_user_id: payment_provider_user_id,
    invoice: invoice,
    order_info: order_info,
    shipping_option: shipping_option,
    credentials_title: credentials_title,
    tip_amount: tip_amount,
  );
}