diff --git a/CHANGELOG.md b/CHANGELOG.md index fde64216f..8d2df2d92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Flet changelog +## 0.7.1 + +* `ButtonStyle` with `shape` or `side` params failed in flet 0.7.0 ([#1390](https://github.com/flet-dev/flet/issues/1390)). + ## 0.7.0 * Programmatically [control scroll position](https://flet.dev/blog/scrolling-controls-and-theming#controlling-scroll-position) and subscribe to [scrolling notifications](https://flet.dev/blog/scrolling-controls-and-theming#receiving-scroll-notifications) in Page, View, Column, Row, ListView and GridView controls. diff --git a/client/lib/main.dart b/client/lib/main.dart index a67b92b14..ac1283d5e 100644 --- a/client/lib/main.dart +++ b/client/lib/main.dart @@ -20,11 +20,7 @@ void main([List? args]) async { //debugPrint("Uri.base: ${Uri.base}"); if (kDebugMode) { - if (kIsWeb) { - pageUrl = "http://localhost:8550"; - } else { - pageUrl = "tcp://localhost:8550"; - } + pageUrl = "http://localhost:8550"; } if (kIsWeb) { diff --git a/client/pubspec.lock b/client/pubspec.lock index b8cc73a0c..00b780644 100644 --- a/client/pubspec.lock +++ b/client/pubspec.lock @@ -175,7 +175,7 @@ packages: path: "../package" relative: true source: path - version: "0.7.0" + version: "0.7.1" flutter: dependency: "direct main" description: flutter diff --git a/package/CHANGELOG.md b/package/CHANGELOG.md index b0e26549b..63eeefafd 100644 --- a/package/CHANGELOG.md +++ b/package/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.1 + +* `ButtonStyle` with `shape` or `side` params failed in flet 0.7.0 ([#1390](https://github.com/flet-dev/flet/issues/1390)). + ## 0.7.0 * Programmatically [control scroll position](https://flet.dev/blog/scrolling-controls-and-theming#controlling-scroll-position) and subscribe to [scrolling notifications](https://flet.dev/blog/scrolling-controls-and-theming#receiving-scroll-notifications) in Page, View, Column, Row, ListView and GridView controls. diff --git a/package/lib/src/utils/material_state.dart b/package/lib/src/utils/material_state.dart index 2802fd35a..e5392c589 100644 --- a/package/lib/src/utils/material_state.dart +++ b/package/lib/src/utils/material_state.dart @@ -2,14 +2,12 @@ import 'package:flutter/material.dart'; MaterialStateProperty? getMaterialStateProperty(dynamic jsonDictValue, T Function(dynamic) converterFromJson, T defaultValue) { - debugPrint("jsonDictValue: $jsonDictValue"); if (jsonDictValue == null) { return null; } var j = jsonDictValue; if (j is! Map) { j = {"": j}; - debugPrint("jsonDictValue DICT: $j"); } return MaterialStateFromJSON(j, converterFromJson, defaultValue); } diff --git a/package/pubspec.yaml b/package/pubspec.yaml index 1ac280d97..fe763f6d6 100644 --- a/package/pubspec.yaml +++ b/package/pubspec.yaml @@ -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 -version: 0.7.0 +version: 0.7.1 # This package supports all platforms listed below. platforms: diff --git a/sdk/python/packages/flet-core/src/flet_core/control.py b/sdk/python/packages/flet-core/src/flet_core/control.py index 5667c8586..38187c150 100644 --- a/sdk/python/packages/flet-core/src/flet_core/control.py +++ b/sdk/python/packages/flet-core/src/flet_core/control.py @@ -145,6 +145,11 @@ def _convert_attr_json(self, value): else None ) + def _wrap_attr_dict(self, value): + if value is None or isinstance(value, Dict): + return value + return {"": value} + def __str__(self): attrs = {} for k, v in self.__attrs.items(): diff --git a/sdk/python/packages/flet-core/src/flet_core/elevated_button.py b/sdk/python/packages/flet-core/src/flet_core/elevated_button.py index 5ae1b42d2..818f93f0e 100644 --- a/sdk/python/packages/flet-core/src/flet_core/elevated_button.py +++ b/sdk/python/packages/flet-core/src/flet_core/elevated_button.py @@ -154,6 +154,9 @@ def _before_build_command(self): self.__style.bgcolor = self.__bgcolor if self.__style.elevation != self.__elevation: self.__style.elevation = self.__elevation + if self.__style is not None: + self.__style.side = self._wrap_attr_dict(self.__style.side) + self.__style.shape = self._wrap_attr_dict(self.__style.shape) self._set_attr_json("style", self.__style) def _get_children(self): diff --git a/sdk/python/packages/flet-core/src/flet_core/icon_button.py b/sdk/python/packages/flet-core/src/flet_core/icon_button.py index 0e23b0272..6a799fb80 100644 --- a/sdk/python/packages/flet-core/src/flet_core/icon_button.py +++ b/sdk/python/packages/flet-core/src/flet_core/icon_button.py @@ -151,6 +151,9 @@ def _get_control_name(self): def _before_build_command(self): super()._before_build_command() + if self.__style is not None: + self.__style.side = self._wrap_attr_dict(self.__style.side) + self.__style.shape = self._wrap_attr_dict(self.__style.shape) self._set_attr_json("style", self.__style) def _get_children(self): diff --git a/sdk/python/packages/flet-core/src/flet_core/outlined_button.py b/sdk/python/packages/flet-core/src/flet_core/outlined_button.py index cc60453c9..5e423b98e 100644 --- a/sdk/python/packages/flet-core/src/flet_core/outlined_button.py +++ b/sdk/python/packages/flet-core/src/flet_core/outlined_button.py @@ -131,6 +131,9 @@ def _get_control_name(self): def _before_build_command(self): super()._before_build_command() + if self.__style is not None: + self.__style.side = self._wrap_attr_dict(self.__style.side) + self.__style.shape = self._wrap_attr_dict(self.__style.shape) self._set_attr_json("style", self.__style) def _get_children(self): diff --git a/sdk/python/packages/flet-core/src/flet_core/text_button.py b/sdk/python/packages/flet-core/src/flet_core/text_button.py index 326e3992b..767f3b4bf 100644 --- a/sdk/python/packages/flet-core/src/flet_core/text_button.py +++ b/sdk/python/packages/flet-core/src/flet_core/text_button.py @@ -131,6 +131,9 @@ def _get_control_name(self): def _before_build_command(self): super()._before_build_command() + if self.__style is not None: + self.__style.side = self._wrap_attr_dict(self.__style.side) + self.__style.shape = self._wrap_attr_dict(self.__style.shape) self._set_attr_json("style", self.__style) def _get_children(self): diff --git a/studio/client/pubspec.lock b/studio/client/pubspec.lock index c4c26072b..da0356324 100644 --- a/studio/client/pubspec.lock +++ b/studio/client/pubspec.lock @@ -167,7 +167,7 @@ packages: path: "../../package" relative: true source: path - version: "0.7.0" + version: "0.7.1" flutter: dependency: "direct main" description: flutter