Closed OwenMcDonnell closed 2 weeks ago
Add dividerless (boolean) attribute to ExpansionTile to allow for transparent dividers between tiles.
dividerless
Fixes #4303
import flet as ft def main(page: ft.Page): page.spacing = 0 page.padding = 0 def handle_expansion_tile_change(e): page.open( ft.SnackBar( ft.Text(f"ExpansionTile was {'expanded' if e.data=='true' else 'collapsed'}"), duration=1000, ) ) if e.control.trailing: e.control.trailing.name = ( ft.icons.ARROW_DROP_DOWN if e.control.trailing.name == ft.icons.ARROW_DROP_DOWN_CIRCLE else ft.icons.ARROW_DROP_DOWN_CIRCLE ) page.update() page.add( ft.ExpansionTile( title=ft.Text("ExpansionTile 1"), subtitle=ft.Text("Trailing expansion arrow icon"), affinity=ft.TileAffinity.PLATFORM, maintain_state=True, collapsed_text_color=ft.colors.RED, text_color=ft.colors.RED, controls=[ft.ListTile(title=ft.Text("This is sub-tile number 1"))], dividerless=True ), ft.ExpansionTile( title=ft.Text("ExpansionTile 2"), subtitle=ft.Text("Custom expansion arrow icon"), trailing=ft.Icon(ft.icons.ARROW_DROP_DOWN), collapsed_text_color=ft.colors.GREEN, text_color=ft.colors.GREEN, on_change=handle_expansion_tile_change, controls=[ft.ListTile(title=ft.Text("This is sub-tile number 2"))], dividerless=True ), ft.ExpansionTile( title=ft.Text("ExpansionTile 3"), subtitle=ft.Text("Leading expansion arrow icon"), affinity=ft.TileAffinity.LEADING, initially_expanded=True, collapsed_text_color=ft.colors.BLUE, text_color=ft.colors.BLUE, controls=[ ft.ListTile(title=ft.Text("This is sub-tile number 3")), ft.ListTile(title=ft.Text("This is sub-tile number 4")), ft.ListTile(title=ft.Text("This is sub-tile number 5")), ], dividerless=True ), ) ft.app(main)
[x] I signed the CLA.
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] My changes generate no new warnings
[x] New and existing tests pass locally with my changes
[ ] I have made corresponding changes to the documentation (if applicable)
Add a 'dividerless' attribute to the ExpansionTile component to enable transparent dividers between tiles, enhancing customization options.
New Features:
Documentation:
Closed in favor of #4311
Description
Add
dividerless
(boolean) attribute to ExpansionTile to allow for transparent dividers between tiles.Fixes #4303
Test Code
Type of change
Checklist:
[x] I signed the CLA.
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] My changes generate no new warnings
[x] New and existing tests pass locally with my changes
[ ] I have made corresponding changes to the documentation (if applicable)
Screenshots (if applicable):
Additional details
Summary by Sourcery
Add a 'dividerless' attribute to the ExpansionTile component to enable transparent dividers between tiles, enhancing customization options.
New Features:
Documentation: