User class final
Represents a user
Constructors
- User({required int id, required String firstName, required String lastName, Usernames? usernames, required String phoneNumber, required UserStatus status, ProfilePhoto? profilePhoto, EmojiStatus? emojiStatus, required bool isContact, required bool isMutualContact, required bool isCloseFriend, required bool isVerified, required bool isPremium, required bool isSupport, required String restrictionReason, required bool isScam, required bool isFake, required bool hasActiveStories, required bool hasUnreadActiveStories, required bool haveAccess, required UserType type, required String languageCode, required bool addedToAttachmentMenu, dynamic extra, int? clientId})
-
Represents a user
const
-
User.fromJson(Map<
String, dynamic> json) -
Parses a User from TDLib JSON.
factory
Properties
- addedToAttachmentMenu → bool
-
True, if the user added the current bot to attachment menu; only available to bots
final
- clientId → int?
-
Identifier of the TDLib client that sent this object.
final
- emojiStatus → EmojiStatus?
-
Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only
final
- extra → dynamic
-
"@extra" of the request this object answers.
final
- firstName → String
-
First name of the user
final
- hasActiveStories → bool
-
True, if the user has non-expired stories available to the current user
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasUnreadActiveStories → bool
-
True, if the user has unread non-expired stories available to the current user
final
- haveAccess → bool
-
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
-
User identifier
final
- isCloseFriend → bool
-
The user is a close friend of the current user; implies that the user is a contact
final
- isContact → bool
-
The user is a contact of the current user
final
- isFake → bool
-
True, if many users reported this user as a fake account
final
- isMutualContact → bool
-
The user is a contact of the current user and the current user is a contact of the user
final
- isPremium → bool
-
True, if the user is a Telegram Premium user
final
- isScam → bool
-
True, if many users reported this user as a scam
final
- isSupport → bool
-
True, if the user is Telegram support account
final
- isVerified → bool
-
True, if the user is verified
final
- languageCode → String
-
IETF language tag of the user's language; only available to bots
final
- lastName → String
-
Last name of the user
final
- phoneNumber → String
-
Phone number of the user
final
- profilePhoto → ProfilePhoto?
-
Profile photo of the user; may be null
final
- restrictionReason → String
-
If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → UserStatus
-
Current online status of the user
final
- type → UserType
-
Type of the user
final
- usernames → Usernames?
-
Usernames of the user; may be null
final
Methods
-
copyWith(
{int? id, String? firstName, String? lastName, Usernames? usernames()?, String? phoneNumber, UserStatus? status, ProfilePhoto? profilePhoto()?, EmojiStatus? emojiStatus()?, bool? isContact, bool? isMutualContact, bool? isCloseFriend, bool? isVerified, bool? isPremium, bool? isSupport, String? restrictionReason, bool? isScam, bool? isFake, bool? hasActiveStories, bool? hasUnreadActiveStories, bool? haveAccess, UserType? type, String? languageCode, bool? addedToAttachmentMenu, dynamic extra, int? clientId}) → User -
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g.
field: () => nullto clear it. -
getConstructor(
) → String -
TDLib type name, e.g.
updateNewMessage.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this object to TDLib JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- CONSTRUCTOR → const String
- TDLib type name.