copyWith method

Session copyWith({
  1. int? id,
  2. bool? isCurrent,
  3. bool? isPasswordPending,
  4. bool? isUnconfirmed,
  5. bool? canAcceptSecretChats,
  6. bool? canAcceptCalls,
  7. SessionType? type,
  8. int? apiId,
  9. String? applicationName,
  10. String? applicationVersion,
  11. bool? isOfficialApplication,
  12. String? deviceModel,
  13. String? platform,
  14. String? systemVersion,
  15. int? logInDate,
  16. int? lastActiveDate,
  17. String? ipAddress,
  18. String? location,
  19. dynamic extra,
  20. int? clientId,
})

Copy model with modified properties.

Properties:

  • id: Session identifier
  • is_current: True, if this session is the current session
  • is_password_pending: True, if a 2-step verification password is needed to complete authorization of the session
  • is_unconfirmed: True, if the session wasn't confirmed from another session
  • can_accept_secret_chats: True, if incoming secret chats can be accepted by the session
  • can_accept_calls: True, if incoming calls can be accepted by the session
  • type: Session type based on the system and application version, which can be used to display a corresponding icon
  • api_id: Telegram API identifier, as provided by the application
  • application_name: Name of the application, as provided by the application
  • application_version: The version of the application, as provided by the application
  • is_official_application: True, if the application is an official application or uses the api_id of an official application
  • device_model: Model of the device the application has been run or is running on, as provided by the application
  • platform: Operating system the application has been run or is running on, as provided by the application
  • system_version: Version of the operating system the application has been run or is running on, as provided by the application
  • log_in_date: Point in time (Unix timestamp) when the user has logged in
  • last_active_date: Point in time (Unix timestamp) when the session was last used
  • ip_address: IP address from which the session was created, in human-readable format
  • location: 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,
    );