Skip to main content

Cacheimg and CacheCircleAvatar control for Flet and preload all images from assets folder via flutter precacheImage.

Project description

flet-cacheimg

Cacheimg and CacheCircleAvatar control for Flet and preload all images from assets folder via flutter precacheImage.

Warning

Images will only be cached in built packages.

flet build ...

If you run project via

flet run

those controls will act exactly the same as basic ft.Image and ft.CircleAvatar.
This is limitation of the current Flet version (0.28.3).

Usage

import flet as ft
from flet_cacheimg import CacheImage, CacheCircleAvatar


def main(page: ft.Page):
    page.add(
        CacheImage(
            src="https://flet.dev/img/logo.svg",
            width=150,
            height=150,
            tooltip="Cached image",
            opacity=0.9,
        )
    )
    page.add(
        CacheCircleAvatar(
            radius=24,
            foreground_image_src='https://flet.dev/img/logo.svg',
        )
    )
    page.add(
        ft.CircleAvatar(
            radius=20,
            content=CacheImage(
                src='https://flet.dev/img/logo.svg',
                width=40,
                height=40,
                fit=ft.ImageFit.COVER,
            ),
        )
    )


ft.app(main)

Installation

Add dependency to pyproject.toml of your Flet app:

  • Git dependency

Link to git repository:

dependencies = [
  "flet-cacheimg @ git+https://github.com/ReYaNOW/flet-cacheimg",
  "flet>=0.28.3",
]
  • PyPi dependency

If the package is published on pypi.org:

dependencies = [
  "flet-cacheimg",
  "flet>=0.28.3",
]

Build your app:

flet build apk -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flet_cacheimg-0.1.5.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flet_cacheimg-0.1.5-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file flet_cacheimg-0.1.5.tar.gz.

File metadata

  • Download URL: flet_cacheimg-0.1.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.4 Windows/10

File hashes

Hashes for flet_cacheimg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 0f055679541085c7b64b2e7599e06d5162da99e96774d63dd5ec1af712acf7fe
MD5 11a108ec85adf586ae974079f7953738
BLAKE2b-256 e88f1ebdfad4c31dc560c4a71c5790330465378f41460792ec7bda3bdf29ea14

See more details on using hashes here.

File details

Details for the file flet_cacheimg-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: flet_cacheimg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.4 Windows/10

File hashes

Hashes for flet_cacheimg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f2e338534c7070c98e8fc18dc5ea701b0cbf92384804b7f45d9802c898ed44c1
MD5 b13d99717e9097f688ad1dd57b76775f
BLAKE2b-256 b6c0f90d0ee9a8779ee80d1c81c6b29765b45b1216c4b69e515841f78c3a5386

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page