UserData class

The user object contains Twitter user account metadata describing the referenced user.

The user object is the primary object returned in the users lookup endpoint. When requesting additional user fields on this endpoint, simply use the fields parameter user.fields.

The user object can also be found as a child object and expanded in the Tweet object. The object is available for expansion with TweetExpansion.authorId or TweetExpansion.inReplyToUserId to get the condensed object with only default fields. Use the expansion with the field parameter: user.fields when requesting additional fields to complete the object.

Annotations
  • @freezed

Constructors

UserData({required String id, required String name, required String username, String? description, String? url, String? profileImageUrl, String? location, @JsonKey(name: 'protected') bool? isProtected, @JsonKey(name: 'verified') bool? isVerified, UserVerifiedType? verifiedType, String? pinnedTweetId, UserEntities? entities, PublicUserMetrics? publicMetrics, DateTime? createdAt, UserWithheld? withheld})
const
factory
UserData.fromJson(Map<String, Object?> json)
factory

Properties

copyWith → $UserDataCopyWith<UserData>
no setterinherited
createdAt DateTime?
The UTC date time that the user account was created on Twitter.
no setterinherited
description String?
The text of this user's profile description (also known as bio), if the user provided one.
no setterinherited
entities UserEntities?
Contains details about text that has a special meaning in the user's description.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier of this user.
no setterinherited
isProtected bool?
Indicates if this user has chosen to protect their Tweets (in other words, if this user's Tweets are private).
no setterinherited
isVerified bool?
Indicates if this user is a verified Twitter User.
no setterinherited
location String?
The location specified in the user's profile, if the user provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries.
no setterinherited
name String
The name of the user, as they’ve defined it on their profile. Not necessarily a person’s name. Typically capped at 50 characters, but subject to change.
no setterinherited
pinnedTweetId String?
Unique identifier of this user's pinned Tweet.
no setterinherited
profileImageUrl String?
The URL to the profile image for this user, as shown on the user's profile.
no setterinherited
publicMetrics → PublicUserMetrics?
Contains details about activity for this user.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url String?
The URL specified in the user's profile, if present.
no setterinherited
username String
The Twitter screen name, handle, or alias that this user identifies themselves with. Usernames are unique but subject to change. Typically a maximum of 15 characters long, but some historical accounts may exist with longer names.
no setterinherited
verifiedType UserVerifiedType?
The Twitter Blue verified type of the user, eg: blue, government, business or none.
no setterinherited
withheld UserWithheld?
Contains withholding details for withheld content, if applicable.
no setterinherited

Methods

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

Operators

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