User class

This object represents a Telegram user or bot.

Constructors

User({required int id, required bool isBot, required String firstName, String? lastName, String? username, String? languageCode, bool? isPremium, bool? addedToAttachmentMenu, bool? canJoinGroups, bool? canReadAllGroupMessages, bool? supportsInlineQueries})
Basic constructor

Properties

addedToAttachmentMenu ↔ bool?
Optional. True, if this user added the bot to the attachment menu
getter/setter pair
canJoinGroups ↔ bool?
Optional. True, if the bot can be invited to groups. Returned only in getMe.
getter/setter pair
canReadAllGroupMessages ↔ bool?
Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
getter/setter pair
firstName ↔ String
User's or bot's first name
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id ↔ int
Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
getter/setter pair
isBot ↔ bool
True, if this user is a bot
getter/setter pair
isPremium ↔ bool?
Optional. True, if this user is a Telegram Premium user
getter/setter pair
languageCode ↔ String?
Optional. IETF language tag of the user's language
getter/setter pair
lastName ↔ String?
Optional. User's or bot's last name
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
supportsInlineQueries ↔ bool?
Optional. True, if the bot supports inline queries. Returned only in getMe.
getter/setter pair
username ↔ String?
Optional. User's or bot's username
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map
Creates a json from the object
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic> json) → User
Creates a object from a json
listFromJsonArray(List json) → List<User>
Creates a list of object from a json array