create static method
User
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "user",
- String special_return_type = "user",
- num? id,
- String? first_name,
- String? last_name,
- Usernames? usernames,
- String? phone_number,
- UserStatus? status,
- ProfilePhoto? profile_photo,
- num? accent_color_id,
- num? background_custom_emoji_id,
- num? profile_accent_color_id,
- num? profile_background_custom_emoji_id,
- EmojiStatus? emoji_status,
- bool? is_contact,
- bool? is_mutual_contact,
- bool? is_close_friend,
- VerificationStatus? verification_status,
- bool? is_support,
- String? restriction_reason,
- bool? has_active_stories,
- bool? has_unread_active_stories,
- bool? restricts_new_chats,
- num? paid_message_star_count,
- bool? have_access,
- UserType? type,
- String? language_code,
override
Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual
Implementation
static User create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "user",
String special_return_type = "user",
num? id,
String? first_name,
String? last_name,
Usernames? usernames,
String? phone_number,
UserStatus? status,
ProfilePhoto? profile_photo,
num? accent_color_id,
num? background_custom_emoji_id,
num? profile_accent_color_id,
num? profile_background_custom_emoji_id,
EmojiStatus? emoji_status,
bool? is_contact,
bool? is_mutual_contact,
bool? is_close_friend,
VerificationStatus? verification_status,
bool? is_premium,
bool? is_support,
String? restriction_reason,
bool? has_active_stories,
bool? has_unread_active_stories,
bool? restricts_new_chats,
num? paid_message_star_count,
bool? have_access,
UserType? type,
String? language_code,
bool? added_to_attachment_menu,
}) {
// User user = User({
final Map user_data_create_json = {
"@type": special_type,
"@return_type": special_return_type,
"id": id,
"first_name": first_name,
"last_name": last_name,
"usernames": (usernames != null) ? usernames.toJson() : null,
"phone_number": phone_number,
"status": (status != null) ? status.toJson() : null,
"profile_photo": (profile_photo != null) ? profile_photo.toJson() : null,
"accent_color_id": accent_color_id,
"background_custom_emoji_id": background_custom_emoji_id,
"profile_accent_color_id": profile_accent_color_id,
"profile_background_custom_emoji_id": profile_background_custom_emoji_id,
"emoji_status": (emoji_status != null) ? emoji_status.toJson() : null,
"is_contact": is_contact,
"is_mutual_contact": is_mutual_contact,
"is_close_friend": is_close_friend,
"verification_status": (verification_status != null) ? verification_status.toJson() : null,
"is_premium": is_premium,
"is_support": is_support,
"restriction_reason": restriction_reason,
"has_active_stories": has_active_stories,
"has_unread_active_stories": has_unread_active_stories,
"restricts_new_chats": restricts_new_chats,
"paid_message_star_count": paid_message_star_count,
"have_access": have_access,
"type": (type != null) ? type.toJson() : null,
"language_code": language_code,
"added_to_attachment_menu": added_to_attachment_menu,
};
user_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (user_data_create_json.containsKey(key) == false) {
user_data_create_json[key] = value;
}
});
}
return User(user_data_create_json);
}