isServerImage method

bool isServerImage()

Returns true if the displayed image comes from the server.

Typical use-case: for OCR methods. In those cases we don't provide an image parameter, we just ask the server: "Use the packaging image you have and run the OCR on it!" That means that it's important to know what we are displaying on the app: if it's a local image, when we run the OCR we run it on another image - the one stored on the server. Which makes no sense.

Implementation

bool isServerImage() => getImage() == null && url != null;