Skip to content

Commit

Permalink
Prepare Flet 0.25.2 (#4541)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Dec 13, 2024
1 parent 3916011 commit 717424a
Show file tree
Hide file tree
Showing 41 changed files with 149 additions and 77 deletions.
8 changes: 7 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ for:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_windows
on:
APPVEYOR_REPO_TAG: true

Expand Down Expand Up @@ -510,3 +509,10 @@ for:
artifacts:
- path: sdk/python/packages/flet-cli/dist/*
- path: sdk/python/packages/flet/dist/*

deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
on:
APPVEYOR_REPO_TAG: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Flet changelog

## 0.25.2

### Bug fixes

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

## 0.25.1

### Changes
Expand Down
13 changes: 13 additions & 0 deletions packages/flet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.25.2

## Bug fixes

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

# 0.25.1

## Changes
Expand Down
5 changes: 2 additions & 3 deletions packages/flet/lib/src/controls/barchart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,8 @@ class _BarChartControlState extends State<BarChartControl> {
getTooltipItem: (group, groupIndex, rod, rodIndex) {
var dp = viewModel.barGroups[groupIndex].barRods[rodIndex];

var tooltip = dp.control.attrString("tooltip") != null
? jsonDecode(dp.control.attrString("tooltip")!)
: dp.control.attrDouble("toY", 0)!.toString();
var tooltip = dp.control.attrString("tooltip",
dp.control.attrDouble("toY", 0)!.toString())!;
var tooltipStyle = parseTextStyle(
Theme.of(context), dp.control, "tooltipStyle");
tooltipStyle ??= const TextStyle();
Expand Down
2 changes: 1 addition & 1 deletion packages/flet/lib/src/controls/dismissible.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _DismissibleControlState extends State<DismissibleControl> {
parseDismissThresholds(widget.control, "dismissThresholds");

DismissDirection direction = parseDismissDirection(
widget.control.attrString("direction"), DismissDirection.horizontal)!;
widget.control.attrString("dismissDirection"), DismissDirection.horizontal)!;

widget.backend.subscribeMethods(widget.control.id,
(methodName, args) async {
Expand Down
5 changes: 1 addition & 4 deletions packages/flet/lib/src/controls/segmented_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
defaultSurfaceTintColor: theme.colorScheme.surfaceTint,
defaultElevation: 1,
defaultPadding: const EdgeInsets.symmetric(horizontal: 8),
defaultBorderSide: BorderSide.none,
defaultShape: theme.useMaterial3
? const StadiumBorder()
: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)));
Expand Down Expand Up @@ -124,9 +123,7 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
return ButtonSegment(
value: segmentView.control.attrString("value")!,
enabled: !segmentDisabled,
tooltip: !segmentDisabled && segmentTooltip != null
? jsonDecode(segmentTooltip)
: null,
tooltip: segmentDisabled ? null : segmentTooltip,
icon: iconCtrls.isNotEmpty
? createControl(segmentView.control, iconCtrls.first.id,
segmentDisabled)
Expand Down
4 changes: 3 additions & 1 deletion packages/flet/lib/src/utils/form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ InputDecoration buildInputDecoration(BuildContext context, Control control,
label: label != null
? createControl(control, label.id, control.isDisabled,
parentAdaptive: adaptive)
: Text(control.attrString("label", "")!),
: control.attrString("label") != null
? Text(control.attrString("label")!)
: null,
labelStyle: parseTextStyle(Theme.of(context), control, "labelStyle"),
border: border,
enabledBorder: border,
Expand Down
42 changes: 21 additions & 21 deletions packages/flet/lib/src/utils/material_state.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:collection';
import 'package:flutter/material.dart';

WidgetStateProperty<T?>? getWidgetStateProperty<T>(
Expand All @@ -8,43 +9,42 @@ WidgetStateProperty<T?>? getWidgetStateProperty<T>(
}
var j = jsonDictValue;
if (j is! Map<String, dynamic>) {
j = {"": j};
j = {"default": j};
}
return WidgetStateFromJSON(j, converterFromJson, defaultValue);
}

class WidgetStateFromJSON<T> extends WidgetStateProperty<T?> {
late final Map<String, T> _states;
late final LinkedHashMap<String, T> _states;
late final T? _defaultValue;

WidgetStateFromJSON(Map<String, dynamic>? jsonDictValue,
T Function(dynamic) converterFromJson, T? defaultValue) {
_defaultValue = defaultValue;
_states = {};
if (jsonDictValue != null) {
jsonDictValue.forEach((stateStr, jv) {
stateStr.split(",").map((s) => s.trim().toLowerCase()).forEach((state) {
_states[state] = converterFromJson(jv);
});
});
}

// preserve user-defined order
_states = LinkedHashMap<String, T>.from(
jsonDictValue?.map((k, v) {
var key = k.trim().toLowerCase();
// "" is deprecated and renamed to "default"
if (key == "") key = "default";
return MapEntry(key, converterFromJson(v));
}) ??
{},
);
}

@override
T? resolve(Set<WidgetState> states) {
//debugPrint("WidgetStateFromJSON states: $states, _states: $_states");
// find specific state
for (var state in states) {
if (_states.containsKey(state.name)) {
return _states[state.name]!;
// Resolve using user-defined order in _states
for (var stateName in _states.keys) {
if (stateName == "default") continue; // Skip "default"; handled last
if (states.any((state) => state.name == stateName)) {
return _states[stateName];
}
}

// catch-all value
if (_states.containsKey("")) {
return _states[""];
}

return _defaultValue;
// Default state
return _states["default"] ?? _defaultValue;
}
}
2 changes: 1 addition & 1 deletion packages/flet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet
description: Write entire Flutter app in Python or add server-driven UI experience into existing Flutter app.
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet
version: 0.25.1
version: 0.25.2

# This package supports all platforms listed below.
platforms:
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_ads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_ads/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_ads
description: Flet Ads control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_ads
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_audio/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_audio
description: Flet Audio control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_audio
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_audio_recorder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_audio_recorder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_audio_recorder
description: Flet AudioRecorder control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_audio_recorder
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_flashlight/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_flashlight/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_flashlight
description: Flet Flashlight control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_flashlight
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_geolocator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_geolocator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_geolocator
description: Flet Geolocator control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_geolocator
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_lottie/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_lottie/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_lottie
description: Flet Lottie control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_lottie
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_map/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
8 changes: 5 additions & 3 deletions packages/flet_map/lib/src/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class _MapControlState extends State<MapControl>
.where((c) => c.isVisible && (acceptedChildrenTypes.contains(c.type)))
.toList();

Curve? defaultAnimationCurve;
Duration? defaultAnimationDuration;
Curve? defaultAnimationCurve =
parseCurve(widget.control.attrString("animationCurve"));
Duration? defaultAnimationDuration =
parseDuration(widget.control, "animationDuration");
var configuration = parseConfiguration(
widget.control, widget.backend, context, const MapOptions())!;

Expand All @@ -76,7 +78,7 @@ class _MapControlState extends State<MapControl>
if (degree != null) {
_animatedMapController.animatedRotateFrom(
degree,
curve: parseCurve(args["curve"]) ?? defaultAnimationCurve,
curve: parseCurve(args["curve"], defaultAnimationCurve),
);
}
case "reset_rotation":
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_map/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_map
description: Flet Map control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_map
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_permission_handler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_permission_handler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_permission_handler
description: Flet PermissionHandler control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_permission_handler
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_rive/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_rive/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_rive
description: Flet Rive control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_rive
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_video/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_video/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_video
description: Flet Video control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_video
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions packages/flet_webview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.25.2

Version follows parent `flet` package.

# 0.25.1

Version follows parent `flet` package.
Expand Down
2 changes: 1 addition & 1 deletion packages/flet_webview/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flet_webview
description: Flet WebView control
homepage: https://flet.dev
repository: https://github.com/flet-dev/flet/packages/flet_webview
version: 0.25.1
version: 0.25.2

environment:
sdk: '>=3.2.3 <4.0.0'
Expand Down
Loading

0 comments on commit 717424a

Please sign in to comment.