Skip to content

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Oct 27, 2025

Fix #4551

Example

import flet as ft


def main(page: ft.Page):
    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

    def handle_fullscreen_change(e: ft.Event[ft.Switch]):
        page.full_screen = e.control.value

    page.add(
        ft.SafeArea(
            ft.Switch(
                value=page.full_screen,
                label="Toggle Fullscreen",
                on_change=handle_fullscreen_change,
            ),
        )
    )


ft.run(main)

Summary by Sourcery

Enable cross-platform fullscreen support by adding Page.full_screen to the Python SDK and set_fullscreen handling in the Dart layer, backed by new IO and web interfaces, and update documentation with usage examples.

New Features:

  • Add Page.full_screen property in Python to toggle fullscreen mode across platforms
  • Implement set_fullscreen method in Dart PageControl to enable fullscreen on desktop, web, and mobile
  • Introduce io_interface.dart and web_interface.dart for unified window fullscreen control

Enhancements:

  • Refactor user_fonts imports to use web_interface or io_interface based on platform
  • Update main.dart desktop detection to rely on isDesktopPlatform()
  • Remove obsolete user_fonts_web.dart

Documentation:

  • Add Toggle Fullscreen section and example to page.md
  • Include a Python fullscreen.py example file

Summary by Sourcery

Enable cross-platform fullscreen support by adding a new Page.full_screen property in the Python SDK and implementing platform-specific fullscreen logic in the Dart layer, backed by unified IO and web interfaces, and update documentation with usage examples.

New Features:

  • Add Page.full_screen property in Python SDK to enable cross-platform fullscreen toggling
  • Implement fullscreen handling in Dart PageControl with unified setWindowFullScreen for desktop, web, and mobile

Enhancements:

  • Refactor user_fonts imports to use new web_interface/io_interface conditional imports
  • Streamline desktop detection in main.dart to use isDesktopPlatform()

Documentation:

  • Add Toggle Fullscreen section and example to page.md
  • Include fullscreen.py example in Python examples

Chores:

  • Remove obsolete user_fonts_web.dart file

@ndonkoHenri ndonkoHenri requested a review from Copilot October 27, 2025 15:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds fullscreen support for mobile and web platforms to complement the existing desktop-only window.full_screen capability. The implementation adds a new cross-platform Page.full_screen property that works across mobile, desktop, and web environments.

Key Changes:

  • Added a new full_screen property to the Python Page class that works across all platforms
  • Implemented platform-specific fullscreen handlers (web uses Fullscreen API, mobile uses SystemUIMode, desktop uses existing window API)
  • Refactored Dart utility files to consolidate web/IO interfaces for better code organization

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/python/packages/flet/src/flet/controls/page.py Adds cross-platform full_screen property with getter/setter to Page class
sdk/python/packages/flet/docs/controls/page.md Documents the new fullscreen toggle feature with usage notes
sdk/python/examples/controls/page/fullscreen.py Provides example implementation of fullscreen toggle functionality
packages/flet/lib/src/utils/web_interface.dart Creates web-specific interface with fullscreen implementation using Fullscreen API
packages/flet/lib/src/utils/user_fonts_web.dart Removes font-only utilities (consolidated into web_interface.dart)
packages/flet/lib/src/utils/user_fonts.dart Updates import to use new consolidated interface files
packages/flet/lib/src/utils/io_interface.dart Adds fullscreen delegation to desktop implementation
packages/flet/lib/src/controls/page.dart Implements platform-specific fullscreen handling in page control
client/lib/main.dart Refactors platform check to use utility function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 27, 2025

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 808d1e1
Status: ✅  Deploy successful!
Preview URL: https://4042584b.flet-docs.pages.dev
Branch Preview URL: https://fullscreen.flet-docs.pages.dev

View logs

@ndonkoHenri ndonkoHenri marked this pull request as draft October 28, 2025 12:07
@ndonkoHenri ndonkoHenri marked this pull request as ready for review October 28, 2025 19:29
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…s, refactor `parseTextInputType`
@ndonkoHenri ndonkoHenri linked an issue Oct 28, 2025 that may be closed by this pull request
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.

Why has NONE been removed? Fullscreen Support hiding the System bar and Navigation bar on Mobile

2 participants