-
Notifications
You must be signed in to change notification settings - Fork 561
v1: IconButton
variants
#5522
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
base: main
Are you sure you want to change the base?
v1: IconButton
variants
#5522
Conversation
Deploying flet-docs with
|
Latest commit: |
83a8098
|
Status: | ✅ Deploy successful! |
Preview URL: | https://020357c9.flet-docs.pages.dev |
Branch Preview URL: | https://v1-icon-button-variants.flet-docs.pages.dev |
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.
We've reviewed this pull request using the Sourcery rules engine
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
||
|
||
@pytest.mark.asyncio(loop_scope="module") | ||
async def test_button_1(flet_app: ftt.FletTestApp, request): | ||
flet_app.page.theme_mode = ft.ThemeMode.LIGHT | ||
await flet_app.assert_control_screenshot( | ||
request.node.name, | ||
ft.Button("Click me"), | ||
control=ft.Button("Click me"), |
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.
control
in that method is a normal, positional, required parameter. Why using it by name here?
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.
Pull Request Overview
This PR introduces Material 3 icon button variants to the Flet Python SDK and Flutter controls, adding support for filled, filled tonal, and outlined IconButtons while consolidating URL handling and style management. The changes include:
- Addition of new icon button variants (
FilledIconButton
,FilledTonalIconButton
,OutlinedIconButton
) - Introduction of a unified
Url
data type to replace separateurl
andurl_target
properties - Improved style handling in IconButton controls with consolidated button properties into
ButtonStyle
Reviewed Changes
Copilot reviewed 54 out of 59 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
sdk/python/packages/flet/src/flet/controls/material/icon_button.py | Added new icon button variants and improved style handling |
sdk/python/packages/flet/src/flet/controls/types.py | Introduced new Url dataclass for unified URL handling |
packages/flet/lib/src/controls/icon_button.dart | Updated Flutter control to support new variants with proper constructors |
packages/flet/lib/src/utils/launch_url.dart | Implemented new URL handling logic and parsing |
sdk/python/packages/flet/src/flet/init.py | Exported new icon button classes |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Closes #5469
Test Code
Summary by Sourcery
Introduce Material 3 icon button variants and update both Python SDK and Dart control implementations to support filled, filled tonal, and outlined IconButtons, while refining style handling and documentation for IconButton properties.
New Features:
Enhancements:
Documentation:
Summary by Sourcery
Introduce new Material 3 icon button variants, unify URL handling with a Url type, refine style mapping and validations, and update documentation and tests accordingly.
New Features:
Enhancements:
Documentation:
Tests: