toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  var map = {
    "client_id": clientId,
    "scope": scopes.join(" "),
  };

  if (audience != null) map = {"audience": audience!, ...map};
  if (clientSecret != null) map = {"client_secret": clientSecret!, ...map};

  return map;
}