getImgById static method

Img? getImgById(
  1. int id
)

Get the image as a Img.

Prefer Img when you need SDK-managed metadata (uid, recommended size/aspectRatio, scalability) or to request raw image bytes; use getImageById when you only need raw image bytes.

Parameters

  • id: image identifier.

Returns

  • Img?: an Img instance when the image exists, or null otherwise.

Also see:

Implementation

static Img? getImgById(int id) {
  final OperationResult resultString = staticMethod(
    'SdkSettings',
    'getImgById',
    args: id,
  );

  if (resultString['result'] == -1) {
    return null;
  }

  return Img.init(resultString['result']);
}