create static method
User
create({
- String special_type = "user",
- String? login,
- num? id,
- String? node_id,
- String? avatar_url,
- String? gravatar_id,
- String? url,
- String? html_url,
- String? followers_url,
- String? following_url,
- String? gists_url,
- String? starred_url,
- String? subscriptions_url,
- String? organizations_url,
- String? repos_url,
- String? events_url,
- String? received_events_url,
- String? type,
- bool? site_admin,
- String? name,
- String? company,
- String? blog,
- String? location,
- String? email,
- bool? hireable,
- String? bio,
- String? twitter_username,
- num? public_repos,
- num? public_gists,
- num? followers,
- num? following,
- String? created_at,
- String? updated_at,
- num? private_gists,
- num? total_private_repos,
- num? owned_private_repos,
- num? disk_usage,
- num? collaborators,
- bool? two_factor_authentication,
- Plan? plan,
- num special_status_code = 0,
override
return original data json
Implementation
static User create({
String special_type = "user",
String? login,
num? id,
String? node_id,
String? avatar_url,
String? gravatar_id,
String? url,
String? html_url,
String? followers_url,
String? following_url,
String? gists_url,
String? starred_url,
String? subscriptions_url,
String? organizations_url,
String? repos_url,
String? events_url,
String? received_events_url,
String? type,
bool? site_admin,
String? name,
String? company,
String? blog,
String? location,
String? email,
bool? hireable,
String? bio,
String? twitter_username,
num? public_repos,
num? public_gists,
num? followers,
num? following,
String? created_at,
String? updated_at,
num? private_gists,
num? total_private_repos,
num? owned_private_repos,
num? disk_usage,
num? collaborators,
bool? two_factor_authentication,
Plan? plan,
num special_status_code = 0,
}) {
// User user = User({
Map user_data_create_json = {
"@type": special_type,
"login": login,
"id": id,
"node_id": node_id,
"avatar_url": avatar_url,
"gravatar_id": gravatar_id,
"url": url,
"html_url": html_url,
"followers_url": followers_url,
"following_url": following_url,
"gists_url": gists_url,
"starred_url": starred_url,
"subscriptions_url": subscriptions_url,
"organizations_url": organizations_url,
"repos_url": repos_url,
"events_url": events_url,
"received_events_url": received_events_url,
"type": type,
"site_admin": site_admin,
"name": name,
"company": company,
"blog": blog,
"location": location,
"email": email,
"hireable": hireable,
"bio": bio,
"twitter_username": twitter_username,
"public_repos": public_repos,
"public_gists": public_gists,
"followers": followers,
"following": following,
"created_at": created_at,
"updated_at": updated_at,
"private_gists": private_gists,
"total_private_repos": total_private_repos,
"owned_private_repos": owned_private_repos,
"disk_usage": disk_usage,
"collaborators": collaborators,
"two_factor_authentication": two_factor_authentication,
"plan": (plan != null)?plan.toJson(): null,
"@status_code": special_status_code,
};
user_data_create_json.removeWhere((key, value) => value == null);
User user_data_create = User(user_data_create_json);
return user_data_create;
}