Skip to content

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Aug 22, 2025

Fix #5581

Summary by Sourcery

Improve TabBarViewControl error handling, height logic, and expand behavior; update tests to cover basic and nested scenarios; fix example ordering

Bug Fixes:

  • Ensure TabBarViewControl emits an error when used outside of a Tabs control
  • Provide a descriptive error for unbounded height and correctly honor the expand property in TabBarViewControl

Enhancements:

  • Refactor TabBarViewControl by extracting buildConstrainedTabView and restructuring LayoutBuilder logic

Documentation:

  • Adjust the nested tabs example to correct content ordering in TabBarView

Tests:

  • Rename and update the basic tabs test to use TabBarView instead of Container
  • Add an integration test for nested Tabs and TabBarView usage

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 fixes an issue with the TabBarView control by restructuring how it handles height constraints and nested tab scenarios. The fix addresses issue #5581 by improving the error handling and layout logic for unbounded height situations.

  • Restructured the TabBarView widget logic to properly handle expand properties and avoid layout builder conflicts
  • Updated integration tests to include a new nesting test case and simplified the basic test structure
  • Modified the nested tabs example to reorder content for better demonstration

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

File Description
sdk/python/packages/flet/integration_tests/controls/test_tabs.py Added comprehensive nesting test case and simplified basic test structure
sdk/python/examples/controls/tabs/nested.py Reordered tab content to demonstrate proper nesting behavior
packages/flet/lib/src/controls/tabs.dart Fixed TabBarView layout logic to handle expand properties and unbounded height scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or 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

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 974738d
Status: ✅  Deploy successful!
Preview URL: https://6eaa4735.flet-docs.pages.dev
Branch Preview URL: https://fix-tabs.flet-docs.pages.dev

View logs

@FeodorFitsner FeodorFitsner merged commit 79e284b into main Aug 22, 2025
5 of 6 checks passed
@FeodorFitsner FeodorFitsner deleted the fix-tabs branch August 22, 2025 19:57
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.

bug: v1: TabBarView - grey view

3 participants