flet
flet copied to clipboard
V1: When a TextStyle is provided through Theme.button_theme.style.text_style, the app throws a Flutter-side exception (only reproducible in debug mode)
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
When a TextStyle is provided through Theme.button_theme.style.text_style, the app throws a Flutter-side exception (only reproducible in debug mode). The same text_style applied directly on a ButtonStyle for individual buttons does not crash.
Also, when using button_theme, there is a visible delay before the style is applied to the button, maybe 1 second. It doesn't happen when the style is applied directly in button.
Code sample
Code
import flet as ft
def main(page: ft.Page):
page.title = "Basic elevated buttons"
page.theme = ft.Theme(
button_theme=ft.ButtonTheme(
style=ft.ButtonStyle(
text_style=ft.TextStyle(
size=20,
italic=True,
# bgcolor=ft.Colors.PURPLE,
# color=ft.Colors.ORANGE,
),
),
)
)
page.add(
ft.Button(
"Button",
),
)
ft.run(main)
To reproduce
- run repro code
uv run flet run -w -p 8550 playground/button_theme_example.py -
fvm flutter run macos -d
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
macOS
Operating system details
macOS
Flet version
0.69.0
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response