Skip to content

fix: improving handling of unbounded width in ResponsiveRow#6354

Open
ndonkoHenri wants to merge 5 commits intomainfrom
fix-responsive-row-width
Open

fix: improving handling of unbounded width in ResponsiveRow#6354
ndonkoHenri wants to merge 5 commits intomainfrom
fix-responsive-row-width

Conversation

@ndonkoHenri
Copy link
Copy Markdown
Contributor

@ndonkoHenri ndonkoHenri commented Mar 29, 2026

Fix #1951

Test code

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.Row(
            controls=[
                ft.ResponsiveRow(
                    # expand=True,
                    controls=[
                        ft.Text("Item 1"),
                        ft.Text("Item 2"),
                    ],
                )
            ]
        )
    )


ft.run(main)

Summary by Sourcery

Handle unbounded layout constraints more robustly and improve visual regression coverage for affected controls.

New Features:

  • Display an explicit error control when a ResponsiveRow is built with unbounded width to guide developers toward supported layouts.

Bug Fixes:

  • Require an icon for NavigationRailDestination to prevent invalid configurations that could lead to runtime issues.

Enhancements:

  • Adjust async test fixtures to use function-scoped Flet test apps, ensuring each test runs with an isolated app instance.

Tests:

  • Add screenshot tests for ResponsiveRow with unbounded width and various controls (PageView, Tabs/TabBarView, NavigationRail, Pagelet) under unbounded height scenarios to guard against regressions.

Copy link
Copy Markdown
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
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 29, 2026

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa5cf52
Status: ✅  Deploy successful!
Preview URL: https://f4a9bd0a.flet-docs.pages.dev
Branch Preview URL: https://fix-responsive-row-width.flet-docs.pages.dev

View logs

Copy link
Copy Markdown
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

Improves handling of layout constraint edge-cases (notably unbounded constraints) by surfacing clear runtime errors in the Flutter client and adding golden/integration coverage for these scenarios.

Changes:

  • Add an explicit unbounded-width guard to ResponsiveRow (Flutter) that renders an ErrorControl with guidance.
  • Add/extend integration + golden tests for unbounded constraint cases (ResponsiveRow width; PageView/Pagelet/NavigationRail/TabBarView height).
  • Adjust Python NavigationRailDestination.icon typing/requiredness and bump client/pubspec.lock to match packages/flet version.

Reviewed changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/flet/lib/src/controls/responsive_row.dart Detects unbounded width and renders a helpful ErrorControl instead of mis-layout.
sdk/python/packages/flet/integration_tests/controls/core/test_responsive_row.py Adds screenshot test coverage for unbounded-width ResponsiveRow.
sdk/python/packages/flet/integration_tests/controls/core/test_page_view.py Adds screenshot test for unbounded-height PageView.
sdk/python/packages/flet/integration_tests/controls/core/test_pagelet.py Adds screenshot test for unbounded-height Pagelet.
sdk/python/packages/flet/integration_tests/controls/material/test_navigation_rail.py Adds screenshot test for unbounded-height NavigationRail.
sdk/python/packages/flet/integration_tests/controls/material/test_tabs.py Adds screenshot test for unbounded-height TabBarView.
sdk/python/packages/flet/src/flet/controls/material/navigation_rail.py Changes NavigationRailDestination.icon to be required in the Python API.
sdk/python/packages/flet/integration_tests/**/golden/**.png New golden images for the added constraint-error scenarios.
client/pubspec.lock Updates locked versions (including flet 0.83.1) consistent with the repo package version.

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa5cf52
Status: ✅  Deploy successful!
Preview URL: https://9c110ded.flet-examples.pages.dev
Branch Preview URL: https://fix-responsive-row-width.flet-examples.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 30, 2026

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa5cf52
Status:🚫  Build failed.

View logs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

ResponsiveRow will not render correctly

2 participants