copyWith method
Session
copyWith({
- int? id,
- bool? isCurrent,
- bool? isPasswordPending,
- bool? isUnconfirmed,
- bool? canAcceptSecretChats,
- bool? canAcceptCalls,
- SessionType? type,
- int? apiId,
- String? applicationName,
- String? applicationVersion,
- bool? isOfficialApplication,
- String? deviceModel,
- String? platform,
- String? systemVersion,
- int? logInDate,
- int? lastActiveDate,
- String? ipAddress,
- String? location,
- dynamic extra,
- int? clientId,
Copy model with modified properties.
Properties:
id: Session identifieris_current: True, if this session is the current sessionis_password_pending: True, if a 2-step verification password is needed to complete authorization of the sessionis_unconfirmed: True, if the session wasn't confirmed from another sessioncan_accept_secret_chats: True, if incoming secret chats can be accepted by the sessioncan_accept_calls: True, if incoming calls can be accepted by the sessiontype: Session type based on the system and application version, which can be used to display a corresponding iconapi_id: Telegram API identifier, as provided by the applicationapplication_name: Name of the application, as provided by the applicationapplication_version: The version of the application, as provided by the applicationis_official_application: True, if the application is an official application or uses the api_id of an official applicationdevice_model: Model of the device the application has been run or is running on, as provided by the applicationplatform: Operating system the application has been run or is running on, as provided by the applicationsystem_version: Version of the operating system the application has been run or is running on, as provided by the applicationlog_in_date: Point in time (Unix timestamp) when the user has logged inlast_active_date: Point in time (Unix timestamp) when the session was last usedip_address: IP address from which the session was created, in human-readable formatlocation: A human-readable description of the location from which the session was created, based on the IP address
Implementation
Session copyWith({
int? id,
bool? isCurrent,
bool? isPasswordPending,
bool? isUnconfirmed,
bool? canAcceptSecretChats,
bool? canAcceptCalls,
SessionType? type,
int? apiId,
String? applicationName,
String? applicationVersion,
bool? isOfficialApplication,
String? deviceModel,
String? platform,
String? systemVersion,
int? logInDate,
int? lastActiveDate,
String? ipAddress,
String? location,
dynamic extra,
int? clientId,
}) =>
Session(
id: id ?? this.id,
isCurrent: isCurrent ?? this.isCurrent,
isPasswordPending: isPasswordPending ?? this.isPasswordPending,
isUnconfirmed: isUnconfirmed ?? this.isUnconfirmed,
canAcceptSecretChats: canAcceptSecretChats ?? this.canAcceptSecretChats,
canAcceptCalls: canAcceptCalls ?? this.canAcceptCalls,
type: type ?? this.type,
apiId: apiId ?? this.apiId,
applicationName: applicationName ?? this.applicationName,
applicationVersion: applicationVersion ?? this.applicationVersion,
isOfficialApplication:
isOfficialApplication ?? this.isOfficialApplication,
deviceModel: deviceModel ?? this.deviceModel,
platform: platform ?? this.platform,
systemVersion: systemVersion ?? this.systemVersion,
logInDate: logInDate ?? this.logInDate,
lastActiveDate: lastActiveDate ?? this.lastActiveDate,
ipAddress: ipAddress ?? this.ipAddress,
location: location ?? this.location,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);