Skip to main content

AndroidBytesBitmap

Image from encoded bytes, such as the contents of a PNG or JPEG file.

The bytes travel with the notification request, so this source works wherever the Python code runs, including flet run against a phone. Prefer it for images shipped with the app or downloaded at runtime.

Example
from pathlib import Path

import flet_notifications as ftn

avatar = ftn.AndroidBytesBitmap(
data=(Path(__file__).parent / "assets" / "avatar.png").read_bytes()
)

Inherits: AndroidBitmap

Properties

  • data - Encoded image bytes.

Properties​

datainstance-attribute​

data: bytes

Encoded image bytes.