toMap method

Map<String, String> toMap()

Convert to a map of name -> content pairs

Implementation

Map<String, String> toMap() {
  final map = <String, String>{'twitter:card': card.value};
  if (title != null) map['twitter:title'] = title!;
  if (description != null) map['twitter:description'] = description!;
  if (image != null) map['twitter:image'] = image!;
  if (imageAlt != null) map['twitter:image:alt'] = imageAlt!;
  if (site != null) map['twitter:site'] = site!;
  if (creator != null) map['twitter:creator'] = creator!;
  if (player != null) map['twitter:player'] = player!;
  if (playerWidth != null) map['twitter:player:width'] = playerWidth!;
  if (playerHeight != null) map['twitter:player:height'] = playerHeight!;
  return map;
}