Skip to content
Discussion options

You must be logged in to vote

Try this. I added some little comments to help you understand. If you still don't, then let me know.

from flet import *

def main(page: flet.Page):
    page.window_width = 400
    page.window_height = 300
    page.window_center()
    page.bgcolor = '#333333'
    page.theme_mode = 'dark'
    page.update()

    def remove_name(n):
        print(f"{n[0]=} | {n[1]=}")
        lv1.controls.remove(n[1])
        page.update()

    lv1 = ListView(expand=True)

    list_of_names = ['Adam Smith', 'Billy Jones', 'Chris Wright', 'David Bates', 'Edward Hass', 'Frank Trigg',
                     'George Hintenbooger', 'Howard Bass']

    for name in list_of_names:
        # store the button in a variable

Replies: 1 comment 1 reply

Comment options

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

Answer selected by AaronCatolico
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