Skip to content

Commit 717424a

Browse files
FeodorFitsnerndonkoHenriomamkaz
authored
Prepare Flet 0.25.2 (#4541)
* feat: implement `Window.ignore_mouse_events` (#4465) * Update project_dependencies.py (#4459) # `Fixed` when I get no markers key in the version_value variable. ```bash Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main flet_cli.cli.main() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main args.handler(args) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle self.package_python_app() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app toml_dependencies = get_poetry_dependencies( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies format_dependency_version(dependency, version) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version if version_value["markers"]: ~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'markers' ``` * Remove `v0.26.0` deprecations (#4479) * delete deprecations on py end * delete deprecations on dart end * fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500) * remove minimum from SafeArea * remove deprecated props * Changelog updated * Fix publishing flet-windows.zip to releases * Revert "Merge branch 'main' into feodor/prepare-0-25-2" This reverts commit 32a7343, reversing changes made to 3dc01e1. * Changelog updated * Update changelog. * Changelog updated with cherry-picked bug fixes * fix broken `Map.center_on()` and default animations (#4519) * fix center_on * get default animation duration and curve * fix: Tooltip corruption in `Segment` and `BarChartRod` on `update()` (#4525) * avoid jsonDecoding `Segment` and `BarChartRod` tooltips * avoid jsonEncoding `Segment` and `BarChartRod` tooltips * Unset theme visual density default * Unset `SegmentedButton` border side default * `TextField.hint_text` should be displayed if `label` is not specified * fix: Setting `CheckBox.border_side.stroke_align` to an Enum fails (#4526) * `BorderSideStrokeAlign` should inherit from float * properly parse `Chip.border_side` * fix:`ControlState` should be resolved based on user-defined order (#4556) * ControlState: rename "" to "default" * resolve ControlState on user-defined order * fix failing tests * remove breaking line * fix wrong attribute name (#4557) * Publish flet wheels to GitHub releases * remove redeclared `MapPointerDeviceType` --------- Co-authored-by: TheEthicalBoy <[email protected]> Co-authored-by: Osama Mohammed Al-zabidi <[email protected]> Co-authored-by: ndonkoHenri <[email protected]>
1 parent 3916011 commit 717424a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+149
-77
lines changed

.appveyor.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ for:
259259
provider: GitHub
260260
auth_token: $(GITHUB_TOKEN)
261261
release: $(APPVEYOR_REPO_TAG_NAME)
262-
artifact: flet_windows
263262
on:
264263
APPVEYOR_REPO_TAG: true
265264

@@ -510,3 +509,10 @@ for:
510509
artifacts:
511510
- path: sdk/python/packages/flet-cli/dist/*
512511
- path: sdk/python/packages/flet/dist/*
512+
513+
deploy:
514+
provider: GitHub
515+
auth_token: $(GITHUB_TOKEN)
516+
release: $(APPVEYOR_REPO_TAG_NAME)
517+
on:
518+
APPVEYOR_REPO_TAG: true

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Flet changelog
22

3+
## 0.25.2
4+
5+
### Bug fixes
6+
7+
* Fix `flet publish` creates broken website if no `requirements.txt` or `pyproject.toml` found ([#4493](https://github.com/flet-dev/flet/pull/4493)).
8+
* Fix PyInstaller hook to avoid download Flet app bundle on first run ([#4549](https://github.com/flet-dev/flet/pull/4549)).
9+
* Support `git`, `path`, `url` Poetry-style dependencies in `pyproject.toml` ([#4554](https://github.com/flet-dev/flet/pull/4554)).
10+
* Fixed broken `Map.center_on()` and default animations ([#4519](https://github.com/flet-dev/flet/pull/4519)).
11+
* Fixed Tooltip corruption in `Segment` and `BarChartRod` on `update()` ([#4525](https://github.com/flet-dev/flet/pull/4525)).
12+
* Fixed Setting `CheckBox.border_side.stroke_align` to an Enum fails ([#4526](https://github.com/flet-dev/flet/pull/4526)).
13+
* Fixed `ControlState should` be resolved based on user-defined order ([#4556](https://github.com/flet-dev/flet/pull/4556)).
14+
* Fixed broken `Dismissible.dismiss_direction` ([#4557](https://github.com/flet-dev/flet/pull/4557)).
15+
316
## 0.25.1
417

518
### Changes

packages/flet/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.25.2
2+
3+
## Bug fixes
4+
5+
* Fix `flet publish` creates broken website if no `requirements.txt` or `pyproject.toml` found ([#4493](https://github.com/flet-dev/flet/pull/4493)).
6+
* Fix PyInstaller hook to avoid download Flet app bundle on first run ([#4549](https://github.com/flet-dev/flet/pull/4549)).
7+
* Support `git`, `path`, `url` Poetry-style dependencies in `pyproject.toml` ([#4554](https://github.com/flet-dev/flet/pull/4554)).
8+
* Fixed broken `Map.center_on()` and default animations ([#4519](https://github.com/flet-dev/flet/pull/4519)).
9+
* Fixed Tooltip corruption in `Segment` and `BarChartRod` on `update()` ([#4525](https://github.com/flet-dev/flet/pull/4525)).
10+
* Fixed Setting `CheckBox.border_side.stroke_align` to an Enum fails ([#4526](https://github.com/flet-dev/flet/pull/4526)).
11+
* Fixed `ControlState should` be resolved based on user-defined order ([#4556](https://github.com/flet-dev/flet/pull/4556)).
12+
* Fixed broken `Dismissible.dismiss_direction` ([#4557](https://github.com/flet-dev/flet/pull/4557)).
13+
114
# 0.25.1
215

316
## Changes

packages/flet/lib/src/controls/barchart.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,8 @@ class _BarChartControlState extends State<BarChartControl> {
263263
getTooltipItem: (group, groupIndex, rod, rodIndex) {
264264
var dp = viewModel.barGroups[groupIndex].barRods[rodIndex];
265265

266-
var tooltip = dp.control.attrString("tooltip") != null
267-
? jsonDecode(dp.control.attrString("tooltip")!)
268-
: dp.control.attrDouble("toY", 0)!.toString();
266+
var tooltip = dp.control.attrString("tooltip",
267+
dp.control.attrDouble("toY", 0)!.toString())!;
269268
var tooltipStyle = parseTextStyle(
270269
Theme.of(context), dp.control, "tooltipStyle");
271270
tooltipStyle ??= const TextStyle();

packages/flet/lib/src/controls/dismissible.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class _DismissibleControlState extends State<DismissibleControl> {
5656
parseDismissThresholds(widget.control, "dismissThresholds");
5757

5858
DismissDirection direction = parseDismissDirection(
59-
widget.control.attrString("direction"), DismissDirection.horizontal)!;
59+
widget.control.attrString("dismissDirection"), DismissDirection.horizontal)!;
6060

6161
widget.backend.subscribeMethods(widget.control.id,
6262
(methodName, args) async {

packages/flet/lib/src/controls/segmented_button.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
4949
defaultSurfaceTintColor: theme.colorScheme.surfaceTint,
5050
defaultElevation: 1,
5151
defaultPadding: const EdgeInsets.symmetric(horizontal: 8),
52-
defaultBorderSide: BorderSide.none,
5352
defaultShape: theme.useMaterial3
5453
? const StadiumBorder()
5554
: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
@@ -124,9 +123,7 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
124123
return ButtonSegment(
125124
value: segmentView.control.attrString("value")!,
126125
enabled: !segmentDisabled,
127-
tooltip: !segmentDisabled && segmentTooltip != null
128-
? jsonDecode(segmentTooltip)
129-
: null,
126+
tooltip: segmentDisabled ? null : segmentTooltip,
130127
icon: iconCtrls.isNotEmpty
131128
? createControl(segmentView.control, iconCtrls.first.id,
132129
segmentDisabled)

packages/flet/lib/src/utils/form_field.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ InputDecoration buildInputDecoration(BuildContext context, Control control,
154154
label: label != null
155155
? createControl(control, label.id, control.isDisabled,
156156
parentAdaptive: adaptive)
157-
: Text(control.attrString("label", "")!),
157+
: control.attrString("label") != null
158+
? Text(control.attrString("label")!)
159+
: null,
158160
labelStyle: parseTextStyle(Theme.of(context), control, "labelStyle"),
159161
border: border,
160162
enabledBorder: border,
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:collection';
12
import 'package:flutter/material.dart';
23

34
WidgetStateProperty<T?>? getWidgetStateProperty<T>(
@@ -8,43 +9,42 @@ WidgetStateProperty<T?>? getWidgetStateProperty<T>(
89
}
910
var j = jsonDictValue;
1011
if (j is! Map<String, dynamic>) {
11-
j = {"": j};
12+
j = {"default": j};
1213
}
1314
return WidgetStateFromJSON(j, converterFromJson, defaultValue);
1415
}
1516

1617
class WidgetStateFromJSON<T> extends WidgetStateProperty<T?> {
17-
late final Map<String, T> _states;
18+
late final LinkedHashMap<String, T> _states;
1819
late final T? _defaultValue;
1920

2021
WidgetStateFromJSON(Map<String, dynamic>? jsonDictValue,
2122
T Function(dynamic) converterFromJson, T? defaultValue) {
2223
_defaultValue = defaultValue;
23-
_states = {};
24-
if (jsonDictValue != null) {
25-
jsonDictValue.forEach((stateStr, jv) {
26-
stateStr.split(",").map((s) => s.trim().toLowerCase()).forEach((state) {
27-
_states[state] = converterFromJson(jv);
28-
});
29-
});
30-
}
24+
25+
// preserve user-defined order
26+
_states = LinkedHashMap<String, T>.from(
27+
jsonDictValue?.map((k, v) {
28+
var key = k.trim().toLowerCase();
29+
// "" is deprecated and renamed to "default"
30+
if (key == "") key = "default";
31+
return MapEntry(key, converterFromJson(v));
32+
}) ??
33+
{},
34+
);
3135
}
3236

3337
@override
3438
T? resolve(Set<WidgetState> states) {
35-
//debugPrint("WidgetStateFromJSON states: $states, _states: $_states");
36-
// find specific state
37-
for (var state in states) {
38-
if (_states.containsKey(state.name)) {
39-
return _states[state.name]!;
39+
// Resolve using user-defined order in _states
40+
for (var stateName in _states.keys) {
41+
if (stateName == "default") continue; // Skip "default"; handled last
42+
if (states.any((state) => state.name == stateName)) {
43+
return _states[stateName];
4044
}
4145
}
4246

43-
// catch-all value
44-
if (_states.containsKey("")) {
45-
return _states[""];
46-
}
47-
48-
return _defaultValue;
47+
// Default state
48+
return _states["default"] ?? _defaultValue;
4949
}
5050
}

packages/flet/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet
22
description: Write entire Flutter app in Python or add server-driven UI experience into existing Flutter app.
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet
5-
version: 0.25.1
5+
version: 0.25.2
66

77
# This package supports all platforms listed below.
88
platforms:

packages/flet_ads/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_ads/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_ads
22
description: Flet Ads control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_ads
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_audio/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_audio/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_audio
22
description: Flet Audio control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_audio
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_audio_recorder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_audio_recorder/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_audio_recorder
22
description: Flet AudioRecorder control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_audio_recorder
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_flashlight/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_flashlight/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_flashlight
22
description: Flet Flashlight control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_flashlight
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_geolocator/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_geolocator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_geolocator
22
description: Flet Geolocator control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_geolocator
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_lottie/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_lottie/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_lottie
22
description: Flet Lottie control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_lottie
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_map/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_map/lib/src/map.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ class _MapControlState extends State<MapControl>
5454
.where((c) => c.isVisible && (acceptedChildrenTypes.contains(c.type)))
5555
.toList();
5656

57-
Curve? defaultAnimationCurve;
58-
Duration? defaultAnimationDuration;
57+
Curve? defaultAnimationCurve =
58+
parseCurve(widget.control.attrString("animationCurve"));
59+
Duration? defaultAnimationDuration =
60+
parseDuration(widget.control, "animationDuration");
5961
var configuration = parseConfiguration(
6062
widget.control, widget.backend, context, const MapOptions())!;
6163

@@ -76,7 +78,7 @@ class _MapControlState extends State<MapControl>
7678
if (degree != null) {
7779
_animatedMapController.animatedRotateFrom(
7880
degree,
79-
curve: parseCurve(args["curve"]) ?? defaultAnimationCurve,
81+
curve: parseCurve(args["curve"], defaultAnimationCurve),
8082
);
8183
}
8284
case "reset_rotation":

packages/flet_map/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_map
22
description: Flet Map control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_map
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_permission_handler/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_permission_handler/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_permission_handler
22
description: Flet PermissionHandler control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_permission_handler
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_rive/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_rive/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_rive
22
description: Flet Rive control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_rive
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_video/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_video/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_video
22
description: Flet Video control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_video
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

packages/flet_webview/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.25.2
2+
3+
Version follows parent `flet` package.
4+
15
# 0.25.1
26

37
Version follows parent `flet` package.

packages/flet_webview/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: flet_webview
22
description: Flet WebView control
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/flet/packages/flet_webview
5-
version: 0.25.1
5+
version: 0.25.2
66

77
environment:
88
sdk: '>=3.2.3 <4.0.0'

0 commit comments

Comments
 (0)