Skip to content
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: 6 additions & 0 deletions .agents/skills/docs-conventions/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ import {CodeExample} from '@site/src/components/crocodocs';

Paths are relative to the configured `examples_root` (`sdk/python/examples/`).

## Inline HTML

Use `<kbd>...</kbd>` in Python docstrings for keyboard keys, for example
`<kbd>Enter</kbd>` or `<kbd>Shift</kbd>`. CrocoDocs preserves this tag in API
docs.

## Sidebar Navigation

Edit `website/sidebars.yml` to change navigation structure:
Expand Down
25 changes: 16 additions & 9 deletions .agents/skills/flet-deprecation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,22 @@ For supported patterns, docs should auto-render:
Do not duplicate with manual deprecation admonitions in docstrings unless there
is a special case not covered by the extension.

## Required Test Matrix

When adding/changing deprecations, include tests for:
- runtime warning text (`reason`, versions, optional delete version),
- docs-only preference (`docs_reason` overrides `reason` in docs),
- docs rendering extraction for the used pattern (`V.deprecated`, `@deprecated`, `@deprecated_class`),
- label presence (`deprecated`) in docs extraction tests.

Prefer:
## Testing Guidance

Do not add one-off tests for every API that gets deprecated when it uses an
existing, already-tested pattern (`V.deprecated`, `@deprecated`, or
`@deprecated_class`). For routine deprecation metadata updates, rely on the
shared helper and docs extraction tests.

Add or update tests only when the change affects deprecation infrastructure or
introduces meaningful new behavior, for example:
- changing runtime warning formatting or stacklevel behavior,
- changing docs extraction/labeling behavior,
- adding a new deprecation pattern,
- adding custom compatibility behavior outside the standard helper,
- fixing a regression where an existing test would not have failed.

Prefer these locations for infrastructure tests:
- `sdk/python/packages/flet/tests/test_deprecated.py`
- `sdk/python/packages/flet/tests/test_griffe_deprecations.py`
- `sdk/python/packages/flet/tests/test_validation.py` (for `V.deprecated`)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Fix `page.window.destroy()` taking several seconds to close Windows desktop apps when `prevent_close` is enabled ([#5459](https://github.com/flet-dev/flet/issues/5459), [#6428](https://github.com/flet-dev/flet/pull/6428)) by @ndonkoHenri.
* Fix `Page.show_drawer()`, `close_drawer()`, and root/top view accessors (`appbar`, `drawer`, `navigation_bar`, `controls`, ...) failing with `TypeError` under `Page.render_views()` by unwrapping component-wrapped views and normalizing single-view returns ([#6413](https://github.com/flet-dev/flet/issues/6413), [#6414](https://github.com/flet-dev/flet/pull/6414)) by @FeodorFitsner.
* Fix `auto_scroll` on scrollable controls silently doing nothing unless `scroll` was also explicitly set ([#6397](https://github.com/flet-dev/flet/issues/6397), [#6404](https://github.com/flet-dev/flet/pull/6404)) by @ndonkoHenri.
* Fix `Lottie` failing to load local asset files on Windows desktop (and unreliably on other desktop platforms), so animations referenced by `src="file.json"` from the app's `assets/` directory now display correctly ([#6386](https://github.com/flet-dev/flet/issues/6386), [#6426](https://github.com/flet-dev/flet/pull/6426)) by @ndonkoHenri.
* Fix `flet pack` desktop packaging so Windows and Linux bundles include the expected client archive, and Windows taskbar pins point to the packed app instead of the cached `flet.exe` ([#5151](https://github.com/flet-dev/flet/issues/5151), [#6403](https://github.com/flet-dev/flet/pull/6403)) by @ndonkoHenri.
* Fix environment variable priority in `flet build` template: inherit from `Platform.environment` and use `putIfAbsent` for FLET_* variables so pre-set system env vars are not overwritten ([#6394](https://github.com/flet-dev/flet/pull/6394)) by @Bahtya.

Expand Down
22 changes: 11 additions & 11 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -359,7 +359,7 @@ packages:
path: "../packages/flet"
relative: true
source: path
version: "0.82.2"
version: "0.85.0"
flet_ads:
dependency: "direct main"
description:
Expand Down Expand Up @@ -895,10 +895,10 @@ packages:
dependency: transitive
description:
name: lottie
sha256: "8ae0be46dbd9e19641791dc12ee480d34e1fd3f84c749adc05f3ad9342b71b95"
sha256: "8b6359a7422167014aa73ce763fa133fb832065dcc0ac4d1dec1f603a5cef7d0"
url: "https://pub.dev"
source: hosted
version: "3.3.2"
version: "3.3.3"
markdown:
dependency: transitive
description:
Expand All @@ -911,18 +911,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
media_kit:
dependency: transitive
description:
Expand Down Expand Up @@ -1628,10 +1628,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.10"
torch_light:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion sdk/python/examples/controls/lottie/assets/sample.json

This file was deleted.

6 changes: 6 additions & 0 deletions sdk/python/packages/flet-lottie/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.85.0

### Fixed

- Fix `Lottie` failing to load local asset files on Windows desktop (and unreliably on other desktop platforms), so animations referenced by `src="file.json"` from the app's `assets/` directory now display correctly ([#6386](https://github.com/flet-dev/flet/issues/6386), [#6426](https://github.com/flet-dev/flet/pull/6426)) by @ndonkoHenri.

## 0.80.0

## Added
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'file_lottie_web.dart' if (dart.library.io) 'file_lottie_io.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'dart:io' as io;

import 'package:flutter/widgets.dart';
import 'package:lottie/lottie.dart';

LottieBuilder fileLottie(
String path, {
bool? animate,
bool? repeat,
bool? reverse,
AlignmentGeometry? alignment,
BoxFit? fit,
FilterQuality? filterQuality,
LottieOptions? options,
bool? backgroundLoading,
ImageErrorWidgetBuilder? errorBuilder,
void Function(LottieComposition)? onLoaded,
void Function(String)? onWarning,
}) =>
Lottie.file(
io.File(path),
animate: animate,
repeat: repeat,
reverse: reverse,
alignment: alignment,
fit: fit,
filterQuality: filterQuality,
options: options,
backgroundLoading: backgroundLoading,
errorBuilder: errorBuilder,
onLoaded: onLoaded,
onWarning: onWarning,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:flutter/widgets.dart';
import 'package:lottie/lottie.dart';

LottieBuilder fileLottie(
String path, {
bool? animate,
bool? repeat,
bool? reverse,
AlignmentGeometry? alignment,
BoxFit? fit,
FilterQuality? filterQuality,
LottieOptions? options,
bool? backgroundLoading,
ImageErrorWidgetBuilder? errorBuilder,
void Function(LottieComposition)? onLoaded,
void Function(String)? onWarning,
}) {
Comment thread
ndonkoHenri marked this conversation as resolved.
// Local file loading is not supported on web. On web, `getAssetSrc`
Comment thread
ndonkoHenri marked this conversation as resolved.
// always returns `isFile: false`, so this code path is unreachable at
// runtime — this stub exists only to keep the package compiling for web.
throw UnsupportedError(
'Lottie.file is not supported on Flutter Web.',
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'package:flet/flet.dart';
import 'package:flutter/widgets.dart';
import 'package:lottie/lottie.dart';

import 'file_lottie.dart';

class LottieControl extends StatefulWidget {
final Control control;

Expand Down Expand Up @@ -91,7 +93,7 @@ class _LottieControlState extends State<LottieControl> {
var assetSrc = widget.control.backend.getAssetSource(resolvedSrc.uri!);
// Local File
if (assetSrc.isFile) {
lottie = Lottie.asset(
lottie = fileLottie(
assetSrc.path,
repeat: repeat,
reverse: reverse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
sdk: flutter

collection: ^1.16.0
lottie: 3.3.2
lottie: 3.3.3

flet:
path: ../../../../../../../packages/flet
Expand Down
39 changes: 29 additions & 10 deletions sdk/python/packages/flet/src/flet/controls/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,51 +1260,70 @@ def pubsub(self) -> "PubSubClient":
return self.session.pubsub_client

@property
@deprecated("Use UrlLauncher() instead.", version="0.80.0", delete_version="0.90.0")
@deprecated(
reason="Use UrlLauncher() instead.",
docs_reason="Use :class:`~flet.UrlLauncher` instead.",
version="0.80.0",
delete_version="0.90.0",
)
def url_launcher(self) -> UrlLauncher:
"""
DEPRECATED: The UrlLauncher service for the current page.
The UrlLauncher service for the current page.
"""
return UrlLauncher()

@property
@deprecated(
"Use BrowserContextMenu() instead.", version="0.80.0", delete_version="0.90.0"
reason="Use BrowserContextMenu() instead.",
docs_reason="Use :class:`~flet.BrowserContextMenu` instead.",
version="0.80.0",
delete_version="0.90.0",
)
def browser_context_menu(self):
"""
DEPRECATED: The BrowserContextMenu service for the current page.
The BrowserContextMenu service for the current page.
"""

return BrowserContextMenu()

@property
@deprecated(
"Use SharedPreferences() instead.", version="0.80.0", delete_version="0.90.0"
reason="Use SharedPreferences() instead.",
docs_reason="Use :class:`~flet.SharedPreferences` instead.",
version="0.80.0",
delete_version="0.90.0",
)
def shared_preferences(self):
"""
DEPRECATED: The SharedPreferences service for the current page.
The SharedPreferences service for the current page.
"""

return SharedPreferences()

@property
@deprecated("Use Clipboard() instead.", version="0.80.0", delete_version="0.90.0")
@deprecated(
reason="Use Clipboard() instead.",
docs_reason="Use :class:`~flet.Clipboard` instead.",
version="0.80.0",
delete_version="0.90.0",
)
def clipboard(self):
"""
DEPRECATED: The Clipboard service for the current page.
The Clipboard service for the current page.
"""

return Clipboard()

@property
@deprecated(
"Use StoragePaths() instead.", version="0.80.0", delete_version="0.90.0"
reason="Use StoragePaths() instead.",
docs_reason="Use :class:`~flet.StoragePaths` instead.",
version="0.80.0",
delete_version="0.90.0",
)
def storage_paths(self):
"""
DEPRECATED: The StoragePaths service for the current page.
The StoragePaths service for the current page.
"""

return StoragePaths()
Expand Down
Loading
Loading