fromMap static method

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

Construct from Map.

Implementation

static StoryViewers? 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 total_count = _map['total_count']! as int;
  var total_reaction_count = _map['total_reaction_count']! as int;
  var viewers = List<StoryViewer>.from(
    (_map["viewers"] ?? []).map(
      (e) => StoryViewer.fromMap(e),
    ),
  );
  var next_offset = _map['next_offset'] as String?;
  return StoryViewers(
    extra: extra,
    clientId: clientId,
    total_count: total_count,
    total_reaction_count: total_reaction_count,
    viewers: viewers,
    next_offset: next_offset,
  );
}