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,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

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,
    );