toMap method Null safety

  1. @mustCallSuper
Map<String, String> toMap()

Implementation

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

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

  if (additionalParameters != null) map = {...map, ...additionalParameters!};

  return map;
}