It`s easy, when u adding any elements by
page.overlay.append(element)
You can align it by Stack
attributes, like this:
import flet as ft
def main(page: ft.Page):
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
page.vertical_alignment = ft.MainAxisAlignment.CENTER
page.window.full_screen = True
overlay_pic = ft.Container(
width=1920,
height=420,
bgcolor="red",
bottom=0,
)
def switch_overlay(e):
if overlay_pic not in page.overlay:
page.overlay.append(overlay_pic)
else:
page.overlay.remove(overlay_pic)
page.update()
button = ft.ElevatedButton(
text='switch overlay',
on_click=switch_overlay
)
page.add(
button
)
ft.app(main)