BasePage
        Inherits: AdaptiveControl
A visual container representing a top-level view in a Flet application.
BasePage serves as the base class for Page and
MultiView, and provides a unified surface for rendering
application content, app bars,
navigation elements, dialogs, overlays, and more. It manages one
or more View instances and exposes high-level layout,
scrolling, and theming properties.
Unlike lower-level layout controls (e.g., Column, Container), BasePage represents an entire logical view or screen of the app. It provides direct access to view-level controls such as AppBar, NavigationBar, FloatingActionButton, and supports system-level events like window resizing and media changes.
This class is not intended to be used directly in most apps; instead, use Page or MultiView, which extend this base functionality.
Properties
- 
          appbar(AppBar | CupertinoAppBar | None) –Gets or sets the top application bar (AppBar or 
- 
          auto_scroll(bool) –
- 
          bgcolor(ColorValue | None) –
- 
          bottom_appbar(BottomAppBar | None) –
- 
          controls(list[BaseControl]) –
- 
          dark_theme(Theme | None) –Customizes the theme of the application when in dark theme mode. 
- 
          decoration(BoxDecoration | None) –
- 
          drawer(NavigationDrawer | None) –
- 
          enable_screenshots(bool) –Enable taking screenshots of the entire page with take_screenshotmethod.
- 
          end_drawer(NavigationDrawer | None) –
- 
          floating_action_button(FloatingActionButton | None) –
- 
          floating_action_button_location(FloatingActionButtonLocation | OffsetValue | None) –
- 
          foreground_decoration(BoxDecoration | None) –
- 
          height(Number | None) –Page height in logical pixels. 
- 
          horizontal_alignment(CrossAxisAlignment) –
- 
          locale_configuration(LocaleConfiguration | None) –Configures supported locales and the current locale. 
- 
          media(PageMediaData) –The current environmental metrics of the page or window. 
- 
          navigation_bar(NavigationBar | CupertinoNavigationBar | None) –
- 
          overlay(list[BaseControl]) –
- 
          padding(PaddingValue | None) –
- 
          scroll(ScrollMode | None) –
- 
          show_semantics_debugger(bool | None) –Whether to turn on an overlay that shows the accessibility information 
- 
          spacing(Number) –
- 
          theme(Theme | None) –Customizes the theme of the application when in light theme mode. Currently, a 
- 
          theme_mode(ThemeMode | None) –The page's theme mode. 
- 
          title(str | None) –Page or window title. 
- 
          vertical_alignment(MainAxisAlignment) –
- 
          views(list[View]) –A list of views managed by the page. 
- 
          width(Number | None) –Page width in logical pixels. 
Events
- 
          on_media_change(EventHandler[PageMediaData] | None) –Called when mediahas changed.
- 
          on_resize(EventHandler[PageResizeEvent] | None) –Called when a user resizes a browser or native OS window containing Flet app, for 
Methods
- 
            add–Adds controls to the page. 
- 
            clean–
- 
            close_drawer–Close the drawer. 
- 
            close_end_drawer–Close the end drawer. 
- 
            insert–Inserts controls at specific index of page.controlslist.
- 
            pop_dialog–Closes the most recently opened dialog. 
- 
            remove–Removes specific controls from page.controlslist.
- 
            remove_at–Remove controls from page.controlslist at specific index.
- 
            scroll_to–Moves scroll position to either absolute offset, relativedeltaor jump to
- 
            show_dialog–Displays a dialog and manages its dismissal lifecycle. 
- 
            show_drawer–Show the drawer. 
- 
            show_end_drawer–Show the end drawer. 
- 
            take_screenshot–Captures a screenshot of the entire page with overlays. 
- 
            update–
Properties#
property
      writable
  
#
appbar: AppBar | CupertinoAppBar | None
Gets or sets the top application bar (AppBar or CupertinoAppBar) for the view.
The app bar typically displays the page title and optional actions such as navigation icons, menus, or other interactive elements.
class-attribute
      instance-attribute
  
#
dark_theme: Theme | None = None
Customizes the theme of the application when in dark theme mode.
class-attribute
      instance-attribute
  
#
enable_screenshots: bool = False
Enable taking screenshots of the entire page with take_screenshot method.
property
      writable
  
#
floating_action_button_location: (
    FloatingActionButtonLocation | OffsetValue | None
)
class-attribute
      instance-attribute
  
#
height: Number | None = None
Page height in logical pixels.
Note
- This property is read-only.
- To get or set the full window height including window chrome (e.g.,
    title bar and borders) when running a Flet app on desktop,
    use the heightproperty ofPage.windowinstead.
class-attribute
      instance-attribute
  
#
locale_configuration: LocaleConfiguration | None = None
Configures supported locales and the current locale.
class-attribute
      instance-attribute
  
#
media: PageMediaData = field(
    default_factory=lambda: PageMediaData(
        padding=zero(),
        view_padding=zero(),
        view_insets=zero(),
        device_pixel_ratio=0,
        orientation=PORTRAIT,
    )
)
The current environmental metrics of the page or window.
This data is updated whenever the platform window or layout changes, such as when rotating a device, resizing a browser window, or adjusting system UI elements like the keyboard or safe areas.
property
      writable
  
#
navigation_bar: (
    NavigationBar | CupertinoNavigationBar | None
)
class-attribute
      instance-attribute
  
#
show_semantics_debugger: bool | None = None
Whether to turn on an overlay that shows the accessibility information reported by the framework.
class-attribute
      instance-attribute
  
#
theme: Theme | None = None
Customizes the theme of the application when in light theme mode. Currently, a theme can only be automatically generated from a "seed" color. For example, to generate light theme from a green color.
class-attribute
      instance-attribute
  
#
    The page's theme mode.
class-attribute
      instance-attribute
  
#
    A list of views managed by the page.
Each View represents a distinct navigation state or screen in the application.
The first view in the list is considered the active one by default.
class-attribute
      instance-attribute
  
#
width: Number | None = None
Page width in logical pixels.
Note
- This property is read-only.
- To get or set the full window height including window chrome (e.g.,
    title bar and borders) when running a Flet app on desktop,
    use the widthproperty ofPage.windowinstead.
Events#
class-attribute
      instance-attribute
  
#
on_media_change: EventHandler[PageMediaData] | None = None
Called when media has changed.
class-attribute
      instance-attribute
  
#
on_resize: EventHandler[PageResizeEvent] | None = None
Methods#
    Inserts controls at specific index of page.controls list.
pop_dialog() -> DialogControl | None
Closes the most recently opened dialog.
This method searches the active dialog stack for the topmost dialog that is currently open, marks it as closed, updates its state, and returns the closed dialog.
Returns:
- 
              DialogControl | None–The closed dialog instance if one was found, otherwise None.
remove_at(index: int) -> None
Remove controls from page.controls list at specific index.
async
  
#
scroll_to(
    offset: Number | None = None,
    delta: Number | None = None,
    scroll_key: str
    | int
    | float
    | bool
    | ScrollKey
    | None = None,
    duration: DurationValue | None = None,
    curve: AnimationCurve | None = None,
) -> None
Moves scroll position to either absolute offset, relative delta or jump to
the control with specified scroll_key.
See Column.scroll_to() for method details
and examples.
show_dialog(dialog: DialogControl) -> None
Displays a dialog and manages its dismissal lifecycle.
This method adds the specified dialog to the active dialog stack
and renders it on the page. If the dialog is already open, an exception
is raised.
The on_dismiss handler of the dialog
is temporarily wrapped to ensure the dialog is removed from the stack and
its dismissal event is triggered appropriately.
Parameters:
- 
            dialog(DialogControl) –The dialog instance to display. Must not already be open. 
Raises:
- 
              Exception–If the specified dialog is already open. 
async
  
#
    
async
  
#
take_screenshot(
    pixel_ratio: Number | None = None,
    delay: DurationValue | None = None,
) -> bytes
Captures a screenshot of the entire page with overlays.
Parameters:
- 
            pixel_ratio(Number | None, default:None) –A pixel ratio of the captured screenshot. If None, device-specific pixel ratio will be used.
- 
            delay(DurationValue | None, default:None) –A delay before taking a screenshot. The delay will be 20 milliseconds if not specified. 
Returns:
- 
              bytes–Screenshot in PNG format.