TweetV2Response.fromJson constructor
This function can accept both JSON that has a list and a single object in data field So both
- {"data": ["created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ...
- {"data": {"created_at": "2020-09-18T18:36:15.000Z", "id": "1061967001177018368", ... are valid
Implementation
factory TweetV2Response.fromJson(Map<String, dynamic> json) =>
_$TweetV2ResponseFromJson(json);