Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlertDialog - icon, bgcolor, elevation #2576

Merged
merged 3 commits into from
Feb 8, 2024
Merged

AlertDialog - icon, bgcolor, elevation #2576

merged 3 commits into from
Feb 8, 2024

Conversation

ndonkoHenri
Copy link
Collaborator

Closes #2520

Test Code:

import flet as ft

def main(page: ft.Page):

    dlg_modal = ft.AlertDialog(
        modal=True,
        title=ft.Text("Please confirm"),
        content=ft.Text("Do you really want to delete all those files?"),
        icon=ft.Icon(ft.icons.WARNING_OUTLINED),
        bgcolor=ft.colors.RED_200,
        elevation=5,
        actions=[
            ft.TextButton("Yes", on_click=lambda e: page.close_dialog()),
            ft.TextButton("No", on_click=lambda e: page.close_dialog()),
        ],
        actions_alignment=ft.MainAxisAlignment.END,
        on_dismiss=lambda e: print("Modal dialog dismissed!"),
    )

    page.add(
        ft.ElevatedButton("Open modal dialog", on_click=lambda e: page.show_dialog(dlg_modal)),
    )

ft.app(target=main)

This reverts commit e73c426.
@ndonkoHenri ndonkoHenri merged commit 7453e54 into main Feb 8, 2024
2 checks passed
@ndonkoHenri ndonkoHenri deleted the alertdialog-props branch February 8, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bgcolor property to AlertDialog control
2 participants