1

Is there any method in adding a background image to the page in Flet python. I can find only .append .add in the docs is it .overlay for that.

Thanks in advance.

I tried with using .overlay but nothing happened.

Jamiu S.
  • 5,257
  • 5
  • 12
  • 34
Jacob
  • 11
  • 3

1 Answers1

3

There is a way to set an image for the page's background which is adding a container to the page as the first control and setting expand=True for that:

...
page.padding = 0
page.add(
    Container(
        image_src='<IMAGE_URL>',
        image_fit=ImageFit.COVER,
        expand=True,
        content=Control()
    )
)
...

The container's content would be your page body.