getCreditCard method

Future<Uint8List> getCreditCard({
  1. required String code,
  2. int? width,
  3. int? height,
  4. int? quality,
})

Get Credit Card Icon

The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Implementation

Future<Uint8List> getCreditCard(
    {required String code, int? width, int? height, int? quality}) async {
  final String path =
      '/avatars/credit-cards/{code}'.replaceAll('{code}', code);

  final Map<String, dynamic> params = {
    'width': width,
    'height': height,
    'quality': quality,
    'project': client.config['project'],
  };

  final res = await client.call(HttpMethod.get,
      path: path, params: params, responseType: ResponseType.bytes);
  return res.data;
}