Page
Page is a container for View
controls.
A page instance and the root view are automatically created when a new user session started.
Properties
auto_scroll
True
if scrollbar should automatically move its position to the end when children updated. Must be False
for scroll_to()
method to work.
appbar
An AppBar
control to display at the top of the Page.
bgcolor
Background color of the Page.
A color value could be a hex value in #ARGB
format (e.g. #FFCC0000
), #RGB
format (e.g. #CC0000
) or a named color from flet.colors
module.
bottom_appbar
BottomAppBar
control to display at the bottom of the Page. If both bottom_appbar
and navigation_bar
properties are provided, NavigationBar
will be displayed.
browser_context_menu
Used to enable or disable the context menu that appears when the user right-clicks on the web page.
Value is of type BrowserContextMenu
.
🌎 Web only.
client_ip
IP address of the connected user.
🌎 Web only.
client_user_agent
Browser details of the connected user.
🌎 Web only.
controls
A list of Controls to display on the Page.
For example, to add a new control to a page:
- Python
page.controls.append(ft.Text("Hello!"))
page.update()
or to get the same result as above using page.add()
method
To remove the top most control on the page:
- Python
page.controls.pop()
page.update()
dark_theme
Customizes the theme of the application when in dark theme mode.
Value is an instance of the Theme()
class - more information in the theming guide.
debug
True
if Flutter client of Flet app is running in debug mode.
decoration
The background decoration.
Value is of type BoxDecoration
.
design
Reserved for future use.
drawer
A NavigationDrawer
control to display as a panel sliding from the start edge of the page.
end_drawer
A NavigationDrawer
control to display as a panel sliding from the end edge of the page.
floating_action_button
A FloatingActionButton
control to display on top of Page content.
floating_action_button_location
Defines a position for the FloatingActionButton
.
Value is of type FloatingActionButtonLocation
enum.
Default is FloatingActionButtonLocation.END_FLOAT
.
fonts
Defines the custom fonts to be used in the application.
Value is a dictionary, in which the keys represent the font family name used for reference and the values
- Key: The font family name used for reference.
- Value: The font source, either an absolute URL or a relative path to a local asset. The following font file formats are supported
.ttc
,.ttf
and.otf
.
Usage example here.
height
A height of a web page or content area of a native OS window containing Flet app. This property is read-only. It's usually being used inside page.on_resized
handler.
horizontal_alignment
How the child Controls should be placed horizontally.
Property value is CrossAxisAlignment
enum. Default is START
.