create static method
Session
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "session",
- String special_return_type = "session",
- num? id,
- bool? is_current,
- bool? is_password_pending,
- bool? is_unconfirmed,
- bool? can_accept_secret_chats,
- bool? can_accept_calls,
- SessionType? type,
- num? api_id,
- String? application_name,
- String? application_version,
- bool? is_official_application,
- String? device_model,
- String? platform,
- String? system_version,
- num? log_in_date,
- num? last_active_date,
- String? ip_address,
- String? location,
override
Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual
Implementation
static Session create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "session",
String special_return_type = "session",
num? id,
bool? is_current,
bool? is_password_pending,
bool? is_unconfirmed,
bool? can_accept_secret_chats,
bool? can_accept_calls,
SessionType? type,
num? api_id,
String? application_name,
String? application_version,
bool? is_official_application,
String? device_model,
String? platform,
String? system_version,
num? log_in_date,
num? last_active_date,
String? ip_address,
String? location,
}) {
// Session session = Session({
final Map session_data_create_json = {
"@type": special_type,
"@return_type": special_return_type,
"id": id,
"is_current": is_current,
"is_password_pending": is_password_pending,
"is_unconfirmed": is_unconfirmed,
"can_accept_secret_chats": can_accept_secret_chats,
"can_accept_calls": can_accept_calls,
"type": (type != null) ? type.toJson() : null,
"api_id": api_id,
"application_name": application_name,
"application_version": application_version,
"is_official_application": is_official_application,
"device_model": device_model,
"platform": platform,
"system_version": system_version,
"log_in_date": log_in_date,
"last_active_date": last_active_date,
"ip_address": ip_address,
"location": location,
};
session_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (session_data_create_json.containsKey(key) == false) {
session_data_create_json[key] = value;
}
});
}
return Session(session_data_create_json);
}