Skip to content
Discussion options

You must be logged in to vote

Could be different versions of Flet package installed.

Anyway, you can't add the same instance of control into the page - each control must be unique.

This is the corrected code:

# import platform
# from flet.border import Border, BorderSide
import flet as ft


def m(page: ft.Page):
    def click_handler(e):
        print("button pressed")
        left_column.controls.append(
            ft.Container(
                content=ft.Text("Random Text"),
                border_radius=10,
                bgcolor=ft.colors.AMBER_400,
                padding=3,
            )
        )
        left_column.update()
        print("updated\n")

    # add/update controls on Page
    page.theme_mode = "…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dynstat
Comment options

Answer selected by dynstat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants