Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .ci/patch_pubspec_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# /// script
# dependencies = ["pyyaml"]
# ///

import os
import pathlib
import sys
Expand All @@ -17,7 +21,7 @@
"flet",
]

with open(pubspec_path, "r") as f:
with open(pubspec_path) as f:
data = yaml.safe_load(f)

# patch version
Expand Down
6 changes: 5 additions & 1 deletion .ci/patch_toml_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# /// script
# dependencies = ["tomlkit"]
# ///

import os
import pathlib
import sys
Expand All @@ -14,7 +18,7 @@
print(f"Patching TOML file {toml_path} to {ver}")

# read
with open(toml_path, "r") as f:
with open(toml_path) as f:
t = tomlkit.parse(f.read())

# patch version
Expand Down
7 changes: 7 additions & 0 deletions .docstr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
paths: src/flet_map
badge: ./docs/assets/badges/docs-coverage.svg
skip_file_doc: True
skip_private: False
ignore_patterns: # Dict with key/value pairs of file-pattern/node-pattern
.*: __post_init__ # Ignore __post_init__ in all files
fail_under: 50
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- dev
paths:
- 'LICENSE'
- 'CHANGELOG.md'
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ This package supports the following platforms:
| Android | ✅ |
| Web | ✅ |

## Installation
## Usage

### Installation

To install the `flet-map` package and add it to your project dependencies:

Expand All @@ -45,6 +47,6 @@ To install the `flet-map` package and add it to your project dependencies:
poetry add flet-map
```

## Examples
### Examples

For examples, see [this](./examples)
For examples, see [these](./examples).
17 changes: 7 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ image: ubuntu
version: '0.1.{build}'

environment:
PYTHON_VERSION: 3.12
UV_PUBLISH_TOKEN:
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw=

stack:
- python 3.12

install:
- source .ci/update_build_version.sh
- python --version
- python -m ensurepip --upgrade
- pip3 install --upgrade tomlkit pyyaml
- curl -LsSf https://astral.sh/uv/install.sh | sh
- export PATH=$HOME/.local/bin:$PATH
- export PATH="$HOME/.local/bin:$PATH"
- uv python install $PYTHON_VERSION
- uv python pin $PYTHON_VERSION

build_script:
- python .ci/patch_toml_version.py pyproject.toml $PYPI_VER
- python .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
- uv run .ci/patch_toml_version.py pyproject.toml $PYPI_VER
- uv run .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
- (cd src/flutter/* && dart pub get && dart analyze && cd -)
- uv build

Expand All @@ -32,4 +29,4 @@ deploy_script:
artifacts:
- path: dist/*.whl

test: off
test: off
7 changes: 2 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ To install the `flet-map` package and add it to your project dependencies:
poetry add flet-map
```

### Examples

## Example

```python title="main.py"
--8<-- "examples/map_example/src/main.py"
```
See [these](map.md#examples).
10 changes: 9 additions & 1 deletion docs/map.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
::: flet_map.map.Map
## Examples

### Example 1

```python title="example_1.py"
--8<-- "examples/map_example/src/example_1.py"
```

::: flet_map.map.Map
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def handle_tap(e: ftm.MapTapEvent):
),
ftm.SimpleAttribution(
text="Flet",
alignment=ft.Alignment.top_right(),
alignment=ft.Alignment.TOP_RIGHT,
on_click=lambda e: print("Clicked SimpleAttribution"),
),
ftm.MarkerLayer(
Expand Down
7 changes: 6 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ plugins:
alias_type: symlink
- glightbox
- section-index
- external-images:
mappings:
- source_dir: examples
target_url_path: examples
include_exts: [ ".png", ".gif", ".svg" ]
- mkdocstrings:
default_handler: python_xref
handlers:
Expand All @@ -174,7 +179,6 @@ plugins:
preload_modules: [ flet ]
filters:
- "!^_" # Exclude private members starting with only one underscore
- "!get_event_field_type"
extensions:
- griffe_modernized_annotations
- griffe_warnings_deprecated
Expand Down Expand Up @@ -225,3 +229,4 @@ markdown_extensions:
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- pymdownx.blocks.caption
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,17 @@ docs = [
"markdown-exec[ansi] >=1.11.0",
"pydocstyle >=6.3.0",
"linkcheckmd >=1.4.0",
"mkdocs-external-images",
{ include-group = 'docs-coverage' },
]
all = [
{ include-group = 'dev' },
{ include-group = 'docs' },
]

[tool.uv.sources]
mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
Expand Down
20 changes: 10 additions & 10 deletions src/flet_map/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from .circle_layer import CircleLayer, CircleMarker
from .map import Map
from .marker_layer import Marker, MarkerLayer
from .polygon_layer import PolygonLayer, PolygonMarker
from .polyline_layer import PolylineLayer, PolylineMarker
from .rich_attribution import RichAttribution
from .simple_attribution import SimpleAttribution
from .source_attribution import (
from flet_map.circle_layer import CircleLayer, CircleMarker
from flet_map.map import Map
from flet_map.marker_layer import Marker, MarkerLayer
from flet_map.polygon_layer import PolygonLayer, PolygonMarker
from flet_map.polyline_layer import PolylineLayer, PolylineMarker
from flet_map.rich_attribution import RichAttribution
from flet_map.simple_attribution import SimpleAttribution
from flet_map.source_attribution import (
ImageSourceAttribution,
SourceAttribution,
TextSourceAttribution,
)
from .tile_layer import TileLayer
from .types import (
from flet_map.tile_layer import TileLayer
from flet_map.types import (
AttributionAlignment,
Camera,
CameraFit,
Expand Down
4 changes: 2 additions & 2 deletions src/flet_map/circle_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import flet as ft

from .map_layer import MapLayer
from .types import MapLatitudeLongitude
from flet_map.map_layer import MapLayer
from flet_map.types import MapLatitudeLongitude

__all__ = ["CircleLayer", "CircleMarker"]

Expand Down
Loading