Page View

The Page View widget displays a scrollable list of pages. It is commonly used for onboarding screens, carousels, or any UI that requires full-page swiping.

Use Cases

The PageView widget lets users swipe between full-screen pages horizontally (or vertically). Each page is usually a complete screen or section.

Use PageView when you want:

  • Onboarding / Intro Screens

    • Multiple slides explaining features of the app

    • Combined with dots/indicators to show progress (like your Digia onboarding)

  • Tabbed, swipeable content

    • Swipe between “Overview / Details / Reviews”

    • News sections, categories, or stories that users can swipe through

  • Step-by-step flows

    • Multi-step forms (Step 1 → Step 2 → Step 3)

    • Tutorials or walkthroughs with one step per page

  • Carousel-style full pages

    • Full-screen banners or hero sections you can swipe

    • Feature highlights or campaigns laid out as separate pages

Core Concepts

  1. Page-by-Page Navigation

    • Content is split into discrete pages, not continuous scroll.

    • User navigates via swipe or programmatic control (using a controller).

  2. PageController & Index

    • A PageController (or similar) manages:

      • Current page index

      • Animating to the next/previous page

    • You can sync this index with indicators, tabs, or other UI.

  3. One Layout per Page

    • Each child is a full layout (could be a whole screen).

    • Perfect when each state/step deserves its own dedicated screen, but you still want smooth swipe navigation.

  4. Horizontal or Vertical

    • Commonly horizontal (like stories or onboarding),

    • Can be vertical if your UX calls for it.

Properties

Property
Description

dataSource

A list of data that can be used to dynamically generate pages.

controller

An expression to control the currently displayed page.

initialPage

The index of the page to show when the widget is first displayed.

viewportFraction

The fraction of the viewport that each page should occupy.

keepPage

If true, the state of each page is preserved as it scrolls off-screen.

allowScroll

If true, the user can scroll between pages.

reverse

If true, the order of the pages is reversed.

padEnds

If true, padding is added to the ends of the list of pages.

pageSnapping

If true, the scroll view will snap to the nearest page.

scrollDirection

The direction of scrolling (horizontal or vertical).

onPageChanged

An action to trigger when the currently displayed page changes.


Default Properties

The Page View widget supports the following section of Default Properties:

Layout

  • width

  • height

  • padding

  • margin

  • align

Last updated