Skip to content

Not able to run example code from flet cookbook in Theming #5263

@dbose-code

Description

@dbose-code

Duplicate Check

Describe the bug

While running the example code from the Cookbook link https://flet.dev/docs/cookbook/theming getting error

Code sample

Code
    bgcolor=ft.Colors.SURFACE_VARIANT,
            ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Colors' has no attribute 'SURFACE_VARIANT'. Did you mean: 'ON_SURFACE_VARIANT'?

To reproduce

Just run the code sample from the Theming Page and it will give the error

Expected behavior

It should run without any issues

Screenshots / Videos

Captures

Image

Operating System

Windows

Operating system details

Windows 11

Flet version

0.27.6

Regression

I'm not sure / I don't know

Suggestions

Yes. Changing to ON_SURFACE_VARIANT runs the code

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

Labels

docsRelated to the documentation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions