profileBanner method

Future<Banner> profileBanner({
  1. String? screenName,
  2. String? userId,
  3. TransformResponse<Banner> transform = defaultBannerTransform,
})

Returns available size variations of the specified user's profile banner.

The profile banner data available at each size variant's URL is in PNG format.

If the user has not uploaded a profile banner, a Future.error is returned instead with the 404 response.

See https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner.

Implementation

Future<Banner> profileBanner({
  String? screenName,
  String? userId,
  TransformResponse<Banner> transform = defaultBannerTransform,
}) {
  final params = <String, String>{}
    ..addParameter('screen_name', screenName)
    ..addParameter('user_id', userId);

  return client
      .get(
        Uri.https('api.twitter.com', '1.1/users/profile_banner.json', params),
      )
      .then(transform);
}