fromJson static method

ReceivedGifts? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static ReceivedGifts? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ReceivedGifts(
    totalCount: (json['total_count'] as int?) ?? 0,
    gifts: List<ReceivedGift>.from(
      tdListFromJson(json['gifts'])
          .map((item) => ReceivedGift.fromJson(tdMapFromJson(item)))
          .whereType<ReceivedGift>(),
    ),
    areNotificationsEnabled:
        (json['are_notifications_enabled'] as bool?) ?? false,
    nextOffset: (json['next_offset'] as String?) ?? '',
  );
}