flet icon indicating copy to clipboard operation
flet copied to clipboard

fix: Improve `Tab`display

Open ndonkoHenri opened this issue 1 month ago • 1 comments

Fix #5599

Summary by Sourcery

Improve tab rendering and per-control theming by centralizing control context handling and aligning Tabs with Flutter's Tab heuristics.

New Features:

  • Add a reusable control context wrapper that combines control reactivity and per-control theming for all controls.
  • Expose a Control extension method to build widgets within the standardized control context.

Bug Fixes:

  • Fix inconsistent Tab display by ensuring TabBar sees tab widgets as Tab instances and by aligning icon/text hints and sizing behavior.

Enhancements:

  • Refactor ControlWidget to use the new control context helper, simplifying widget construction and theme application.
  • Introduce a TabControl that extends Flutter's Tab to provide better integration with TabBar sizing and icon/label heuristics while still using Flet controls for content.
  • Ensure TabBar tabs created from arbitrary controls are wrapped in Tab widgets for consistent hover and splash behavior.
  • Add per-control theme resolution that respects theme, dark_theme, and theme_mode properties, falling back to the parent theme and system brightness as appropriate.

ndonkoHenri avatar Dec 14 '25 16:12 ndonkoHenri