User class final

Represents a user

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

User({required int id, required String firstName, required String lastName, Usernames? usernames, required String phoneNumber, UserStatus? status, ProfilePhoto? profilePhoto, required int accentColorId, required int backgroundCustomEmojiId, UpgradedGiftColors? upgradedGiftColors, required int profileAccentColorId, required int profileBackgroundCustomEmojiId, EmojiStatus? emojiStatus, required bool isContact, required bool isMutualContact, required bool isCloseFriend, VerificationStatus? verificationStatus, required bool isPremium, required bool isSupport, RestrictionInfo? restrictionInfo, ActiveStoryState? activeStoryState, required bool restrictsNewChats, required int paidMessageStarCount, required bool haveAccess, UserType? type, required String languageCode, required bool addedToAttachmentMenu})

Properties

accentColorId int
accentColorId Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview
final
activeStoryState ActiveStoryState?
activeStoryState State of active stories of the user; may be null if the user has no active stories
final
addedToAttachmentMenu bool
addedToAttachmentMenu True, if the user added the current bot to attachment menu; only available to bots
final
backgroundCustomEmojiId int
backgroundCustomEmojiId Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none
final
emojiStatus EmojiStatus?
emojiStatus Emoji status to be shown instead of the default Telegram Premium badge; may be null
final
firstName String
firstName First name of the user
final
hashCode int
The hash code for this object.
no setteroverride
haveAccess bool
haveAccess If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method
final
id int
id User identifier
final
isCloseFriend bool
isCloseFriend The user is a close friend of the current user; implies that the user is a contact
final
isContact bool
isContact The user is a contact of the current user
final
isMutualContact bool
isMutualContact The user is a contact of the current user and the current user is a contact of the user
final
isPremium bool
isPremium True, if the user is a Telegram Premium user
final
isSupport bool
isSupport True, if the user is Telegram support account
final
languageCode String
languageCode IETF language tag of the user's language; only available to bots
final
lastName String
lastName Last name of the user
final
paidMessageStarCount int
paidMessageStarCount Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay
final
phoneNumber String
phoneNumber Phone number of the user
final
profileAccentColorId int
profileAccentColorId Identifier of the accent color for the user's profile; -1 if none
final
profileBackgroundCustomEmojiId int
profileBackgroundCustomEmojiId Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none
final
profilePhoto ProfilePhoto?
profilePhoto Profile photo of the user; may be null
final
restrictionInfo RestrictionInfo?
restrictionInfo Information about restrictions that must be applied to the corresponding private chat; may be null if none
final
restrictsNewChats bool
restrictsNewChats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status UserStatus?
status Current online status of the user
final
type UserType?
type Type of the user
final
upgradedGiftColors UpgradedGiftColors?
upgradedGiftColors Color scheme based on an upgraded gift to be used for the user instead of accent_color_id and background_custom_emoji_id; may be null if none
final
usernames Usernames?
usernames Usernames of the user; may be null
final
verificationStatus VerificationStatus?
verificationStatus Information about verification status of the user; may be null if none
final

Methods

copyWith({int? id, String? firstName, String? lastName, Usernames? usernames, String? phoneNumber, UserStatus? status, ProfilePhoto? profilePhoto, int? accentColorId, int? backgroundCustomEmojiId, UpgradedGiftColors? upgradedGiftColors, int? profileAccentColorId, int? profileBackgroundCustomEmojiId, EmojiStatus? emojiStatus, bool? isContact, bool? isMutualContact, bool? isCloseFriend, VerificationStatus? verificationStatus, bool? isPremium, bool? isSupport, RestrictionInfo? restrictionInfo, ActiveStoryState? activeStoryState, bool? restrictsNewChats, int? paidMessageStarCount, bool? haveAccess, UserType? type, String? languageCode, bool? addedToAttachmentMenu}) User

Available on User, provided by the UserExtensions extension

getConstructor() String
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(Map<String, dynamic>? json) User?

Constants

constructor → const String