-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose more properties in Controls #4105
Conversation
Reviewer's Guide by SourceryThis pull request exposes more properties in various controls, enhancing their customization capabilities. It also includes some refactoring and code improvements across multiple files. Class diagram for updated TextField classclassDiagram
class TextField {
+Optional[bool] enable_interactive_selection
+Optional[bool] enable_ime_personalized_learning
+Optional[bool] can_request_focus
+Optional[bool] ignore_pointers
+Optional[bool] enable_scribble
+Optional[bool] animate_cursor_opacity
+Optional[bool] always_call_on_tap
+PaddingValue scroll_padding
+Optional[ClipBehavior] clip_behavior
+Optional[Brightness] keyboard_brightness
+Optional[MouseCursor] mouse_cursor
+Optional[StrutStyle] strut_style
+OptionalControlEventCallable on_click
+Optional[Control] helper
+Optional[Control] error
+Union[None, str, Control] prefix_icon
+Union[None, str, Control] suffix_icon
+Optional[str] focus_color
+Optional[bool] align_label_with_hint
+DurationValue hint_fade_duration
+Optional[int] hint_max_lines
+Optional[int] helper_max_lines
+Optional[int] error_max_lines
+Optional[str] prefix_icon_color
+Optional[BoxConstraints] prefix_icon_size_constraints
+Optional[str] suffix_icon_color
+Optional[BoxConstraints] suffix_icon_size_constraints
}
Class diagram for updated Text classclassDiagram
class Text {
+Optional[bool] show_selection_cursor
+Optional[bool] enable_interactive_selection
+OptionalNumber selection_cursor_width
+OptionalNumber selection_cursor_height
+Optional[str] selection_cursor_color
+OptionalControlEventCallable on_tap
+OptionalEventCallable[TextSelectionChangeEvent] on_selection_change
}
Class diagram for updated Icon classclassDiagram
class Icon {
+Union[BoxShadow, List[BoxShadow], None] shadows
+OptionalNumber fill
+Optional[bool] apply_text_scaling
+OptionalNumber grade
+OptionalNumber weight
+OptionalNumber optical_size
}
Class diagram for updated PopupMenuButton classclassDiagram
class PopupMenuButton {
+PaddingValue menu_padding
+Optional[ButtonStyle] style
+Optional[AnimationStyle] popup_animation_style
+Optional[BoxConstraints] size_constraints
+OptionalControlEventCallable on_select
}
Class diagram for updated GestureDetector classclassDiagram
class GestureDetector {
+Optional[bool] exclude_from_semantics
+Optional[bool] trackpad_scroll_causes_scale
+Optional[Set[PointerDeviceType]] allowed_devices
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ndonkoHenri - I've reviewed your changes - here's some feedback:
Overall Comments:
- This is a substantial update that greatly expands the capabilities of many controls. While this flexibility is welcome, we should be cautious about the increased API surface area and ensure that documentation is updated to reflect all these new options.
- The deprecation of MapPointerDeviceType in favor of PointerDeviceType is a good move for consistency. Consider adding migration guides or warnings to help users transition to the new enum.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Please resolve conflicts. |
# Conflicts: # packages/flet/lib/src/controls/cupertino_textfield.dart # packages/flet/lib/src/controls/navigation_bar.dart # sdk/python/packages/flet-core/src/flet_core/buttons.py # sdk/python/packages/flet-core/src/flet_core/elevated_button.py
Could you look at the conflict please? |
@@ -205,7 +205,7 @@ def before_update(self): | |||
self._set_attr_json("labelStyle", self.__label_style) | |||
self._set_attr_json("padding", self.__padding) | |||
self._set_attr_json("shape", self.__shape) | |||
self._set_attr_json("color", self.__color) | |||
self._set_attr_json("color", self.__color, wrap_attr_dict=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it's been changed in multiple controls. Do you have any examples/tests to see if anything is broken by that?
* main: (31 commits) Migrate `colors` and `icons` variables to Enums (flet-dev#4180) feat: expose more properties in Controls (flet-dev#4105) feat!: Refactor `Badge` Control to a Dataclass; create new `Control.badge` property (flet-dev#4077) fix: clicking on `CupertinoContextMenuAction` doesn't close context menu (flet-dev#3948) fix dropdown `max_menu_height` (flet-dev#3974) Fix undefined name "Future" --> asyncio.Future (flet-dev#4230) wrap ListTile in material widget (flet-dev#4206) Update CONTRIBUTING.md (flet-dev#4208) TextField: suffix_icon, prefix_icon and icon can be Control or str (flet-dev#4173) feat!: enhance `Map` control (flet-dev#3994) skip running flutter doctor on windows if no_rich_output is True (flet-dev#4108) add --pyinstaller-build-args to pack cli command (flet-dev#4187) fix/feat: make `SearchBar`'s view height adjustable; add new properties (flet-dev#4039) fix: prevent button `style` from being modified in `before_update()` (flet-dev#4181) fix: disabling filled buttons is not visually respected (flet-dev#4090) when `label` is set, use `MainAxisSize.min` for the `Row` (flet-dev#3998) fix: `NavigationBarDestination.disabled` has no visual effect (flet-dev#4073) fix autofill in CupertinoTextField (flet-dev#4103) Linechart: jsonDecode tooltip before displaying (flet-dev#4069) fixed bgcolor, color and elevation (flet-dev#4126) ...
Summary by Sourcery
Enhance the Flet core library by introducing new properties across multiple controls, including TextField, Text, Icon, PopupMenuButton, GestureDetector, Draggable, and NavigationBarDestination, to provide more customization and interaction options. Refactor existing functions and controls to improve flexibility, error handling, and support for adaptive design.
New Features:
Enhancements: