flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.56k stars 452 forks source link

Setting `ButtonStyle.text_style` displays grey screen #4144

Closed ClearSafety closed 4 weeks ago

ClearSafety commented 1 month ago

Duplicate Check

Describe the bug

I'm using the control 'TextButton' and would like to customize its text. In 'style' property of 'TextButton', I'm using the class 'ButtonStyle'.

When I use TextStyle as value for 'style' (that is a property of 'ButtonStyle'), it displays a grey page. You can see it in the pictures attached.

Code sample

Code ```python import flet as ft def main(page: ft.Page): btn = ft.TextButton( text='Text Button 1', style=ft.ButtonStyle( color=ft.colors.GREEN, text_style=ft.TextStyle( size=10 ) ) ) page.add(btn) ft.app(target=main) ```

To reproduce

Just run the code.

Expected behavior

No response

Screenshots / Videos

Captures [Upload m ![no TextStyle](https://github.com/user-attachments/assets/8a319a4f-63bc-4710-a54a-4d1d5acaad0a) ![with TextStyle](https://github.com/user-attachments/assets/e8ad1a47-fa7f-4e43-a641-e220858b0d55) edia here]

Operating System

Windows

Operating system details

Windows 11 Pro

Flet version

0.24.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response