Skip to content

ft.Colors.SURFACE_VARIANT --> AttributeError since flet 0.25.2 #4744

Description

@NiTRoeSE

Duplicate Check

Describe the bug

Hi, after deprecation warning from flet >= 0.25 that the color enum have changed, i replaced ft.colors with 'ft.Colors' in whole code.
The color "ft.Colors.SURFACE_VARIANT" isn't present anymore. --> AttributeError: type object 'Colors' has no attribute 'SURFACE_VARIANT'. Did you mean: 'ON_SURFACE_VARIANT'? ( no i don't mean 'ON_SURFACE_VARIANT' )
In flet < 0.25 "ft.colors.SURFACE_VARIANT" works fine.

Code sample

Code
[Paste your code here]

To reproduce

User color ft.colors.SURFACE_VARIANT somewhere in your code and run it with flet < 0.25.
Change enum to ft.Colors.SURFACE_VARIANT and run it with flet >= 0.25 --> color not found anymore.

Expected behavior

That it works even after changing the enum.

Screenshots / Videos

Captures

[Upload media here]

Operating System

macOS

Operating system details

15.2

Flet version

0.25.2

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

Maybe SURFACE_VARIANT was simply forgotten to port.. ?

Logs

Logs
AttributeError: type object 'Colors' has no attribute 'SURFACE_VARIANT'. Did you mean: 'ON_SURFACE_VARIANT'?

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions