View
Inherits: ScrollableControl, LayoutControl
View is the top most container for all other controls.
A root view is automatically created when a new user session started. From layout
perspective the View represents a Column
control, so it has a similar behavior and shares same properties.
Properties
-
appbar(AppBar | CupertinoAppBar | None) –An
AppBarcontrol to display at the top of -
bgcolor(ColorValue | None) –Background color of the view.
-
bottom_appbar(BottomAppBar | None) –A
BottomAppBarcontrol to display at the bottom of -
can_pop(bool) – -
controls(list[BaseControl]) –A list of controls to display.
-
decoration(BoxDecoration | None) –The background decoration.
-
drawer(NavigationDrawer | None) –A
NavigationDrawercontrol to -
end_drawer(NavigationDrawer | None) –A
NavigationDrawercontrol to -
floating_action_button(FloatingActionButton | None) –A
FloatingActionButtoncontrol to display on top -
floating_action_button_location(FloatingActionButtonLocation | OffsetValue | None) –Describes position of
floating_action_button -
foreground_decoration(BoxDecoration | None) –The foreground decoration.
-
horizontal_alignment(CrossAxisAlignment) –How the child Controls should be placed horizontally.
-
navigation_bar(NavigationBar | CupertinoNavigationBar | None) –A navigation bar (
NavigationBaror -
padding(PaddingValue | None) –A space between page contents and its edges.
-
route(str | None) –View's route - not currently used by Flet framework, but can be used in a user
-
spacing(Number) –The vertical spacing between
controlson thePage. -
vertical_alignment(MainAxisAlignment) –Defines how the child
controlsshould be placed vertically.
Events
-
on_confirm_pop(ControlEventHandler[View] | None) –
Methods
Properties#
appbar
#
appbar: AppBar | CupertinoAppBar | None = None
An AppBar control to display at the top of
the Page.
bottom_appbar
#
bottom_appbar: BottomAppBar | None = None
A BottomAppBar control to display at the bottom of
the Page.
drawer
#
drawer: NavigationDrawer | None = None
A NavigationDrawer control to
display as a panel sliding from the start edge of the view.
end_drawer
#
end_drawer: NavigationDrawer | None = None
A NavigationDrawer control to
display as a panel sliding from the end edge of the view.
floating_action_button
#
floating_action_button: FloatingActionButton | None = None
A FloatingActionButton control to display on top
of Page content.
floating_action_button_location
#
floating_action_button_location: (
FloatingActionButtonLocation | OffsetValue | None
) = None
Describes position of floating_action_button
foreground_decoration
#
foreground_decoration: BoxDecoration | None = None
The foreground decoration.
horizontal_alignment
#
horizontal_alignment: CrossAxisAlignment = START
How the child Controls should be placed horizontally.
navigation_bar
#
navigation_bar: (
NavigationBar | CupertinoNavigationBar | None
) = None
A navigation bar (NavigationBar or
CupertinoNavigationBar) control to display
at the bottom of the Page.
padding
#
padding: PaddingValue | None = field(
default_factory=lambda: all(10)
)
A space between page contents and its edges.
route
#
View's route - not currently used by Flet framework, but can be used in a user
program to update Page.route when a view popped.
spacing
#
spacing: Number = 10
The vertical spacing between controls on the Page.
Note
Has effect only when vertical_alignment
is set to MainAxisAlignment.START,
MainAxisAlignment.END, or MainAxisAlignment.CENTER.
vertical_alignment
#
vertical_alignment: MainAxisAlignment = START
Defines how the child controls should be placed vertically.