https://github.com/ReYaNOW/flet-cacheimg
https://github.com/ReYaNOW/flet-cacheimg
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ReYaNOW/flet-cacheimg
- Owner: ReYaNOW
- License: other
- Created: 2025-08-03T09:12:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-14T15:58:01.000Z (11 months ago)
- Last Synced: 2026-01-14T09:34:43.186Z (7 months ago)
- Language: Dart
- Size: 86.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flet - flet-cacheimg - Drop-in CacheImage and CacheCircleAvatar controls that cache network images on disk. (Libraries / Community Extensions)
README
# flet-cacheimg
Cacheimg and CacheCircleAvatar control for Flet.
### 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
```python
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
```