TweetV2Response class

Comparing this model to Twitter API V1, it is important to notice that in V2 most of the fields are optional. The only required fields are id and text. But this package might require some more fields to properly display tweets. Those need to be included in expansion parameters.

Annotations
  • @JsonSerializable()

Constructors

TweetV2Response({required Object data, TweetV2Includes includes = const TweetV2Includes()})
TweetV2Response.fromJson(Map<String, dynamic> json)
This function can accept both JSON that has a list and a single object in data field So both
factory
TweetV2Response.fromRawJson(String str)
This function can accept both JSON that has a list and a single object in data field So both
factory

Properties

data Object
This field will contain the actual tweet. One endpoints of twitter API returns here a list an another returns a single object, hence Object but in reality it should always be either TweetV2 or List
final
hashCode int
The hash code for this object.
no setterinherited
includes TweetV2Includes
This field will contain any objects referenced from tweet inside data field, like media, users or tweets
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tweet TweetV2
This is the tweet extracted from data field
final

Methods

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

Operators

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