Metadata-Version: 2.3
Name: flet-cacheimg
Version: 0.1.2
Summary: Cacheimg and CacheCircleAvatar control for Flet
Home-page: https://github.com/ReYaNOW/flet-cacheimg
Author: Flet contributors
Author-email: you@example.com
Requires-Python: >=3.9
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: flet (>=0.28.3)
Project-URL: Documentation, https://github.com/ReYaNOW/flet-cacheimg
Project-URL: Issues, https://github.com/ReYaNOW/flet-cacheimg/issues
Project-URL: Repository, https://github.com/ReYaNOW/flet-cacheimg
Description-Content-Type: text/markdown

# flet-cacheimg
Cacheimg and CacheCircleAvatar controls 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 Cacheimg, CacheCircleAvatar


def main(page: ft.Page):
    page.add(
        Cacheimg(
            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=Cacheimg(
                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
```

