fromMap static method

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

Construct from Map.

Implementation

static InlineQueryResults? 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 inline_query_id = _map['inline_query_id']! as int64;
  var button = InlineQueryResultsButton.fromMap(_map['button']);
  var results = List<InlineQueryResult>.from(
    (_map["results"] ?? []).map(
      (e) => InlineQueryResult.fromMap(e),
    ),
  );
  var next_offset = _map['next_offset'] as String?;
  return InlineQueryResults(
    extra: extra,
    clientId: clientId,
    inline_query_id: inline_query_id,
    button: button,
    results: results,
    next_offset: next_offset,
  );
}