跳到主要内容

VerticalDivider

A thin vertical line, with padding on either side.

In the material design language, this represents a divider.

Examples

Live example

import flet as ft

def main(page: ft.Page):

page.add(
ft.Row(
[
ft.Container(
bgcolor=ft.colors.ORANGE_300,
alignment=ft.alignment.center,
expand=True,
),
ft.VerticalDivider(),
ft.Container(
bgcolor=ft.colors.BROWN_400,
alignment=ft.alignment.center,
expand=True,
),
ft.VerticalDivider(width=1, color="white"),
ft.Container(
bgcolor=ft.colors.BLUE_300,
alignment=ft.alignment.center,
expand=True,
),
ft.VerticalDivider(width=9, thickness=3),
ft.Container(
bgcolor=ft.colors.GREEN_300,
alignment=ft.alignment.center,
expand=True,
),
],
spacing=0,
expand=True,
)
)

ft.app(target=main)

Properties

color

The color to use when painting the line.

thickness

The thickness of the line drawn within the divider. A divider with a thickness of 0.0 is always drawn as a line with a width of exactly one device pixel. If this is null, then this defaults to 0.0.

width

The divider's width. The divider itself is always drawn as a vertical line that is centered within the width specified by this value. If this is null, then this defaults to 16.0.