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

Create page.design property with values Material (default), Cupertino, Adaptive #2588

Closed
InesaFitsner opened this issue Feb 9, 2024 · 0 comments · Fixed by #2607
Closed
Assignees

Comments

@InesaFitsner
Copy link
Contributor

InesaFitsner commented Feb 9, 2024

Description
If page.design = ft.PageDesign.CUPERTINO CupertinoApp should be created.

If page.design = ft.PageDesign.ADAPTIVE CupertinoApp or MaterialApp should be created depending on page.platform value and adaptive property should be True for all child controls that don't have adaptive property set.

Code example to reproduce the issue:

import flet as ft


def main(page):

    page.appbar = ft.CupertinoAppBar(
        leading=ft.TextButton("Edit"),
        middle=ft.Text("Settings"),
        trailing=ft.IconButton(icon=ft.cupertino_icons.ADD),
    )

    page.window_width = 393
    page.window_height = 700
    page.theme_mode = ft.ThemeMode.LIGHT

    def dark_light_mode_changed(e):
        if page.theme_mode == ft.ThemeMode.LIGHT:
            page.theme_mode = ft.ThemeMode.DARK
        else:
            page.theme_mode = ft.ThemeMode.LIGHT
        page.update()

    dark_mode_checkbox = ft.Checkbox(
        value=False, label="Dark Mode", on_change=dark_light_mode_changed
    )

    page.add(
        dark_mode_checkbox,
    )


ft.app(target=main)
@InesaFitsner InesaFitsner changed the title CupertinoAppBar doesn't change color for the dark theme Create page.design property with values Material (default), Cupertino, Adaptive Feb 9, 2024
@FeodorFitsner FeodorFitsner moved this to 🏗 In progress in Flet Development Feb 11, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Flet Development Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants